Custom Fields help!!!
-
I have written a code which generates a within the custom field where i type in IMAGE and type in teh url. It will show up a thumbnail in a specific place. Now in the code it says that if a thumbnail does not exists, it automatically gives it a default thumbnail.
What i want to achieve is, i want another block in a custom field saying if it says “WHATEVER” or something, it will hide everything including thumbnails and keep the content.
Can someone help, this is the thumbnail code..
<?php $image = get_post_meta($post->ID,"Image",true); if ( !empty($image) ) { ?> <img src="<?php echo $image; ?>" alt="thumbnail" style="float: left;margin: 0.9em 0.5em 0.5em 0.1em; border: 2px solid #B3B3B3; width: 150px; height: 150px;" /><?php } else { ?> <img src="http://*****.com/blog/wp-content/uploads/no-thumb.png" alt="default thumbnail" style="float: left; margin: 0.9em 0.5em 0.5em 0.1em; border: 2px solid #B3B3B3; width: 150px; height: 150px;" /><?php } ?> <?php the_content('<span class="more-link">'.__('More…', 'plaintxtblog').'</span>') ?>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Custom Fields help!!!’ is closed to new replies.