Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Adding this snippet to the loop of your wordpress theme within single.php or index.php will let you use a custom field value to define if a post is displayed in full or just the excerpt.
- <?php if (have_posts()) :
- while (have_posts()) : the_post();
- $customField = get_post_custom_values("full");
- if (isset($customField[0])) {
- the_title();
- the_content();
- } else {
- the_title();
- the_excerpt();
- endwhile;
- endif;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement