Show multiple excerpts on archive pages & NOT homepage
-
Hello ??
Any help will be appreciated.
I have a site that uses the most recent post the_content on the homepage/front page.
I used this code to allow the_content on the homepage/front page and the_excerpt on the archive/cat/search page results and put this in my temlate-parts/content.php child theme files.
https://dailydose.rankubator.com
<div class="entry-content"> <?php if ( is_home() ) { /* translators: %s: Name of current post */ the_content( sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), get_the_title() ) ); } else { the_excerpt( sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), get_the_title() ) ); } wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentysixteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>%', 'separator' => '<span class="screen-reader-text">, </span>', ) ); ?> </div><!-- .entry-content -->
My issue is that the reading settings have to be set to 1 post to be displayed for my homepage/front page which I want to show the most current post and to have previous and next buttons functionality.
This also forces the archive results pages, category etc to show only 1 excerpt.
Is there a code that I can implement here to show 6 posts on just the archive/category etc?
<?php query_posts('post_type=post&cat=3&showposts=5'); ?> <?php while ( have_posts() ) : the_post(); ?>
Something like this? If so where does it go?
- The topic ‘Show multiple excerpts on archive pages & NOT homepage’ is closed to new replies.