Advertisement
srikat

Untitled

May 1st, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. // get the manual excerpt
  2. $post = get_post( $page->ID );
  3. $the_excerpt = $post->post_excerpt;
  4.  
  5. // if manual excerpt is present, show it otherwise first 40 words of the Page content
  6. if ( empty( $the_excerpt ) ) {
  7. echo '<div class="excerpt">' . excerpt( '40' ) . '</div>';
  8. } else {
  9. echo '<div class="excerpt">' . $the_excerpt . '</div>';
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement