122 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 50+ items on Envato Market
+2 more
jayjdk says

Hello,

I’m working on a new WordPress theme. There’s a picture slider on the front page which is showing a picture with link to a bigger version.

Here’s a screenshot

\\

What do you think would be the best way to get the images? Right now does it get x attachments from a gallery page, but I don’t think that’s the best way as the control over the images wouldn’t be very good.

Another solution could be to create a page, when trough custom fields enter the image links.

Can’t decide which solution is the best, so I hope you guys can help me with what you think would be the best solution. You’re more than welcome to come up with your own if you have one.

Hope you can understand what I mean

Thanks :)

2457 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $100+ on Envato Market
  • Has referred 100+ members
  • Has been a beta tester for an Envato feature
+3 more
digitalimpact says

I think this would be feasible :)

Just make sure you set the default thumb size to whatever your slider uses.

122 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 50+ items on Envato Market
+2 more
jayjdk says

How would you use that in a slider? :) There’ll be several images, not just a single one so I don’t think that would work :(

38 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $100+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
SpadUK says

I have been deciding over this too and I’m leaning more towards adding custon fields to the admin panel and then just linking to the images, and then adding a description field for each image.

18 posts
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
  • Located in United Kingdom
wprebel says

You could get the first image inserted into a post and use timthumb to scale it to the size of the slider but the problem with timthumb is keeping aspect ratio of the image.

I think personally the best way is custom fields and the user makes a predefined image of the size of the slider that way preserving aspect ratio and quality. ;)

2457 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $100+ on Envato Market
  • Has referred 100+ members
  • Has been a beta tester for an Envato feature
+3 more
digitalimpact says
How would you use that in a slider? :) There’ll be several images, not just a single one so I don’t think that would work :(

Simple: within a custom query :)

Why use custom fields when you could have the post thumbnail so easily generated by WordPress 2.9 and up?...

688 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+3 more
_rg_ says

what i will do? Create a page for the images, then attach them to that page, then on the template, just loop the images (attachements) and get the path to them. One page, and inside all the images, simple.

Also you could do same thing using the gallery and getting the images from tempate building a simple function.

Could be many ways, but just think what is the easy way for an user.

122 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 50+ items on Envato Market
+2 more
jayjdk says
what i will do? Create a page for the images, then attach them to that page, then on the template, just loop the images (attachements) and get the path to them. One page, and inside all the images, simple.

Also you could do same thing using the gallery and getting the images from tempate building a simple function.

Could be many ways, but just think what is the easy way for an user.

That’s the way it’s done right now, but as wprebel could it give problems with the aspect ratio of the image. It would give more “problems” if the user attached an image less than 940×300px to the page.

Why use custom fields when you could have the post thumbnail so easily generated by WordPress 2.9 and up?...

The post thumbnail function isn’t the best way for the thing I want. It would properly be great if I wanted to loop trough posts, but I want to show images.

Thanks for all for replies! Really useful :)

2457 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $100+ on Envato Market
  • Has referred 100+ members
  • Has been a beta tester for an Envato feature
+3 more
digitalimpact says

Sorry about that Jay, I admit I read your question a little too fast and I misunderstood :)

240 posts
  • Has been part of the Envato Community for over 5 years
  • Located in Canada
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
rarepearldesign says

I would create an theme options page that let’s the user paste url’s to any media files they’ve uploaded. Something like:

Option 1 - Fixed number of Images
------------------------------------------------
Home Slider Options:

Image 1: [Text]
Image 2: [Text]
Image 3: [Text]
Image 4: [Text]

Algorithm:
1) On home template with slider make a call to get all the images for your slider from the theme options and create the markup for the slider. Use TimThumb script to scale and crop to your specified size.
Option 2 - Unlimited number of Images
------------------------------------------------------

Same as above but make the theme options a textarea box and let the user enter multiple photo paths delimited by some known character like ';'

Home Slider Options:

Images: [Text Area]

Algorithm:
1) On home template with slider make a call to get all the images for your slider from the theme option and implode the string into an array where you can loop through all the images and create the markup for the slider. Use TimThumb script to scale and crop to your specified size.

That likely confused you more, or I didn't understand your needs exactly.
by
by
by
by
by
by