hide post thumbnail with custom field?
-
Hi!
I want to hide a thumbnail in a post – but only in the single view (the post thumbnail should show up everywhere else).
I tried it with a custom field called hidethumb, so when it is activated it should just show nothing but doesn’t work:
<?php
$hidethumb = get_post_meta($post->ID, “hidethumb”, true);
if ( function_exists(‘has_post_thumbnail’) && has_post_thumbnail() ) {
the_post_thumbnail(array(150,150), array(“class” => “alignleft post_thumbnail”));else if ($hidethumb) {
echo “”;}
?>any suggestion?
Thank you!!
AD
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘hide post thumbnail with custom field?’ is closed to new replies.