• Resolved graham333

    (@graham333)


    Hi folks,

    On other themes it’s a seemingly a simple matter to replace
    <?php the_content(); ?>
    with
    <?php the_excerpt(); ?>

    Looks like convention went out the window with 2012 as neither is used, so my question is how do I get excerpts to show on Category pages instead of full Posts?

    Any ideas how to do this please?

    I’m not a coder, so need idiot-proof instructions, thanks ??

    Here’s the code from category.php in case it helps


    get_header(); ?>

    <section id=”primary” class=”site-content”>
    <div id=”content” role=”main”>

    <?php if ( have_posts() ) : ?>
    <header class=”archive-header”>

    <?php if ( category_description() ) : // Show an optional category description ?>
    <div class=”archive-meta”><?php echo category_description(); ?></div>
    <?php endif; ?>
    </header><!– .archive-header –>

    <?php
    /* Start the Loop */
    while ( have_posts() ) : the_post();

    /* Include the post format-specific template for the content. If you want to
    * this in a child theme then include a file called called content-___.php
    * (where ___ is the post format) and that will be used instead.
    */
    get_template_part( ‘content’, get_post_format() );

    endwhile;

    twentytwelve_content_nav( ‘nav-below’ );
    ?>

    <?php else : ?>
    <?php get_template_part( ‘content’, ‘none’ ); ?>
    <?php endif; ?>

    </div><!– #content –>
    </section><!– #primary –>

Viewing 2 replies - 1 through 2 (of 2 total)
  • in content.php, lok at this section:

    <?php if ( is_search() ) : // Only display Excerpts for Search ?>
    		<div class="entry-summary">
    			<?php the_excerpt(); ?>
    		</div><!-- .entry-summary -->
    		<?php else : ?>
    		<div class="entry-content">
    			<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?>
    			<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
    		</div><!-- .entry-content -->
    		<?php endif; ?>

    edit the first line to:

    <?php if ( is_search() || is_category() ) : // Only display Excerpts for Search and Category ?>
    Thread Starter graham333

    (@graham333)

    Dang, who put it in there ??

    Thanks Michael, you are a steely-eyed WordPress man ??

    Marking as resolved

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘2012 theme | Help Req'd To Show 'The Excerpt'?’ is closed to new replies.