Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Thumbnail display - custom field based.
- *
- * Let's say you've got a custom field with the name "show_thumb"
- * You type "yes" as its value to display the thumbnail (or a default picture); any other value won't show any picture, only the content.
- * Don't know so much about custom field, maybe you would prefer using a checkbox, if possible, rather than a text field...
- */
- if( get_post_meta($post->ID, "show_thumb", true) == "yes") :
- $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
- }
- endif; ?>
- <?php the_content('<span class="more-link">'.__('More…', 'plaintxtblog').'</span>') ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement