1

Already searched on here and couldn't find question so forgive me if it's been asked. I'm trying to use dynamic images on a homepage so my client can maintain the images. I've seen tutorials where one person uses post_thumbnails while another uses custom fields. Do I need to create a post for each image and display post_thumbnail on homepage? Or is it better to use custom fields for one post to display multiple images?

Reference:

the_post_thumbnail() http://ontwik.com/wordpress/creating-a-wordpress-theme-part-1/

get_post_custom() http://ontwik.com/web-design/how-to-design-a-portfolio-site-part-2/

similar question

4
  • Are you setting a static page as the homepage? Dec 26, 2011 at 15:28
  • Yes, I made a custom home.php for homepage. Homepage shows different products they carry.
    – Danger14
    Dec 26, 2011 at 17:34
  • If Products are custom posts, then post thumbnails will be a better option, but it means only one image per post. If your client is adding/editing the products via the visual editor, then he can upload the images in the media library and use the image urls wherever he wants the images. Dec 26, 2011 at 18:18
  • You're welcome... no problem, I'm glad I could help a bit! Dec 31, 2011 at 9:33

2 Answers 2

0

If your page is a portfolio index, where each image is meant to relate to a post or page, then post thumbnails would be the way to go.

If your page is simply a gallery page, and the images don't relate to any content beyond that page, then the best method would be to upload images as attachments to that page and output them in your template with get_posts.

1
  • Thanks for the help. Let me do some research and talking to client.
    – Danger14
    Dec 27, 2011 at 5:04
0

better is the_post_thumbnail();

custom fields were used while thumbnail feature was not introduced.

1
  • Thanks for the help. Let me do some research and talking to client.
    – Danger14
    Dec 27, 2011 at 5:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.