• Resolved Magdalena Halford

    (@magdalena-halford)


    This may be a really simple question but how do I get my category results pages to show only excerpts instead of full posts?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    First, try settings->reading and change from “full” to “summary”. If that doesn’t fix it, then how are you with PHP coding?

    Thread Starter Magdalena Halford

    (@magdalena-halford)

    It is set to “summary” yet continues to show full. I can change code if someone tells me what to replace and where . . .

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Please provide a link to your site! Thanks.

    Thread Starter Magdalena Halford

    (@magdalena-halford)

    https://www.livemybestlife.com/
    thank you for looking!

    Thread Starter Magdalena Halford

    (@magdalena-halford)

    I still have not figured out how to fix this. The “search” feature displays excepts, but the category pages display full posts, and I want them to display a list of excerpts. Can anyone help please?

    Thread Starter Magdalena Halford

    (@magdalena-halford)

    Here is the content.php code

    <?php
    /**
    * The default template for displaying content
    *
    * Used for both single and index/archive/search.
    *
    * @package WordPress
    * @subpackage Twenty_Fourteen
    * @since Twenty Fourteen 1.0
    */
    ?>

    <article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
    <?php twentyfourteen_post_thumbnail(); ?>

    <header class=”entry-header”>
    <?php if ( in_array( ‘category’, get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>
    <div class=”entry-meta”>
    <span class=”cat-links”><?php echo get_the_category_list( _x( ‘, ‘, ‘Used between list items, there is a space after the comma.’, ‘twentyfourteen’ ) ); ?></span>
    </div>
    <?php
    endif;

    if ( is_single() ) :
    the_title( ‘<h1 class=”entry-title”>’, ‘</h1>’ );
    else :
    the_title( ‘<h1 class=”entry-title”>‘, ‘</h1>’ );
    endif;
    ?>

    <div class=”entry-meta”>
    <?php
    if ( ‘post’ == get_post_type() )
    twentyfourteen_posted_on();

    if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) :
    ?>
    <span class=”comments-link”><?php comments_popup_link( __( ‘Leave a comment’, ‘twentyfourteen’ ), __( ‘1 Comment’, ‘twentyfourteen’ ), __( ‘% Comments’, ‘twentyfourteen’ ) ); ?></span>
    <?php
    endif;

    edit_post_link( __( ‘Edit’, ‘twentyfourteen’ ), ‘<span class=”edit-link”>’, ‘</span>’ );
    ?>
    </div><!– .entry-meta –>
    </header><!– .entry-header –>

    <?php if ( is_search() ) : ?>
    <div class=”entry-summary”>
    <?php the_excerpt(); ?>
    </div><!– .entry-summary –>
    <?php else : ?>
    <div class=”entry-content”>
    <?php
    /* translators: %s: Name of current post */
    the_content( sprintf(
    __( ‘Continue reading %s <span class=”meta-nav”>→</span>’, ‘twentyfourteen’ ),
    the_title( ‘<span class=”screen-reader-text”>’, ‘</span>’, false )
    ) );

    wp_link_pages( array(
    ‘before’ => ‘<div class=”page-links”><span class=”page-links-title”>’ . __( ‘Pages:’, ‘twentyfourteen’ ) . ‘</span>’,
    ‘after’ => ‘</div>’,
    ‘link_before’ => ‘<span>’,
    ‘link_after’ => ‘</span>’,
    ) );
    ?>
    </div><!– .entry-content –>
    <?php endif; ?>

    <?php the_tags( ‘<footer class=”entry-meta”><span class=”tag-links”>’, ”, ‘</span></footer>’ ); ?>
    </article><!– #post-## –>

    Thread Starter Magdalena Halford

    (@magdalena-halford)

    Still haven’t figures this one out, would really appreciate some help! Thank you

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Thread Starter Magdalena Halford

    (@magdalena-halford)

    I looked for that to replace it, but in the content.php or category.php code there is no instance of the_content()

    The “search” feature works fine, and results are displayed by excerpt, but the “category” results still show full articles

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    I can see the_content in the code you pasted above! Dig through the template files. It’s there, somewhere.

    Thread Starter Magdalena Halford

    (@magdalena-halford)

    Ok I see the_content (in the content.php code I pasted above) but when I replace that with the_excerpt it doesn’t change, the category pages still show all full posts

    Thread Starter Magdalena Halford

    (@magdalena-halford)

    Ok nevermind, when I load the page with a clear cache it did work! Thank you for your time helping me see what I was overlooking

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Display excerpts on category pages’ is closed to new replies.