122 posts
  • Bought between 50 and 99 items
  • Denmark
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
  • Sold between 1 000 and 5 000 dollars
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 :)

2429 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Europe
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Sold between 100 and 1 000 dollars
  • Microlancer Beta Tester
digitalimpact says

I think this would be feasible :)

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

122 posts
  • Bought between 50 and 99 items
  • Denmark
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
  • Sold between 1 000 and 5 000 dollars
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
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 100 and 1 000 dollars
  • United Kingdom
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
  • Exclusive Author
  • Has been a member for 4-5 years
  • 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. ;)

2429 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Europe
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Sold between 100 and 1 000 dollars
  • Microlancer Beta Tester
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
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 1 and 9 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 5 000 and 10 000 dollars
  • Uruguay
_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
  • Bought between 50 and 99 items
  • Denmark
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
  • Sold between 1 000 and 5 000 dollars
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 :)

2429 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Europe
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Sold between 100 and 1 000 dollars
  • Microlancer Beta Tester
digitalimpact says

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

240 posts
  • Bought between 10 and 49 items
  • Canada
  • Exclusive Author
  • Has been a member for 4-5 years
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