Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I need a way to selectively hide or allow thumbnails of featured images to appear on the front page of my site. Ideally, it would be a custom field on each post, where I could choose - for example - 1 or 0 to represent appear or remain hidden. Can someone provide the solution? Thank you.

share|improve this question
1  
I believe you gave yourself the solution, custom fields. :) –  Jared Feb 11 '12 at 18:06
add comment

1 Answer 1

A custom field would certainly do the job. If you wanted a slightly more elegant way of doing it, you could make a meta box (or maybe even hook the featured image box...not sure if that's doable or not off the top of my head) and add a checkbox for 'Display on Frontpage' or something like that.

Once you have that, its just a matter of modifying the loop on your frontpage so that (and this is pseudocode...so don't think it'll work)

if( custom_post_meta == desired_custom_post_meta ) {
     the_post_thumbnail();
}

and you should be done!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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