• Hi all,

    I’m having trouble targetting a page and displaying the exerpt.

    *A side note*
    adding add_post_type_support( 'page', 'excerpt' ); to your functions brings an ‘exerpt’ select box into the ‘screen options’ menu for pages!

    Thanks to Michael Fields for that one https://wordpress.mfields.org/2010/excerpts-for-pages-in-wordpress-3-0/
    * end side not*

    Adding this query_posts( 'post_type=page' ); above the loop displays all the pages, with exerpts, if there is one, if not it displays the content.

    Which is all good, but I need to target just one page at a time. Any ideas?

Viewing 1 replies (of 1 total)
  • Thread Starter geoffmuskett

    (@geoffmuskett)

    This is the full code for that section:

    <?php query_posts( 'post_type=page' );?>
    
    	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    		<article <?php post_class() ?> id="post-<?php the_ID(); ?>">
    
    			<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
    
    			<div class="entry">
    				<?php the_excerpt(); ?>
    			</div>
    
    		</article>
Viewing 1 replies (of 1 total)
  • The topic ‘Displaying an exerpt from a specific page’ is closed to new replies.