WordPress.org

Support

Support » Themes and Templates » The Erudite » How to make latest article use the excerpt on front page?

How to make latest article use the excerpt on front page?

Viewing 2 replies - 1 through 2 (of 2 total)
  • All you need to do is make use of the is_front_page() conditional tag.
    You will also have to fetch the latest post using the WP_Query

    Am example is shown below.

    <?php 
    
    $args = array(
    'posts_per_page' => 1; //this fetch only the first recent post
    );
    
    $loop = new WP_Query( $args );
    if ( $the_query->have_posts() ) :
    while ( $the_query->have_posts() ) : $the_query->the_post();
    
    if( is_front_page(): )
    the_excerpt();
    endif;
    
    endwhile;
    endif;
    
    ?>

    Thanks Tublz, any idea exactly what I should edit in the Erudite theme?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to make latest article use the excerpt on front page?’ is closed to new replies.
Skip to toolbar