Show the excerpt instead of content
-
<ul class="thumbnails"> <?php $mypages = get_pages( array( 'child_of' => $post->ID, 'sort_column' => 'post_date', 'sort_order' => 'desc' ) ); foreach( $mypages as $page ) { $content = $page->post_content; if ( ! $content ) // Check for empty page continue; $content = apply_filters( 'the_content', $content ); ?> <li class="span4"> <article class="thumbnail clearfix"> <h3><a href="<?php echo get_page_link( $page->ID ); ?>"><?php echo $page->post_title; ?></a></h3> <p><?php echo $content; ?></p> <a href="<?php echo get_page_link( $page->ID ); ?>" class="btn btn-primary pull-right">Read More</a> </article> </li> <?php } ?> </ul>
Im using this function http://codex.wordpress.org/Function_Reference/get_pages#Displaying_Child_pages_of_the_current_page_in_post_format
This shows me the whole content, I only want the excerpt.
I tried the echo $excerpt and the_excerpt with no success.
Anybody know the solution? Thanks
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Show the excerpt instead of content’ is closed to new replies.