Excerpt not showing […]
-
I’ve been customizing my own home page, displaying posts separately from the main blog page. I found code that is suppose to add a “Continue Reading” link to my excerpts but when I implement it, it doesn’t show. According to the site I got it from:
http://zeaks.org/2012/display-excerpts-in-twenty-twelve-theme
(scroll down to “Adding the Continue Reading Link”)It replaces the […] that shows up at end of excerpts. Thing is, my excerpts don’t even have that and I am thinking that is the reason this new code doesn’t work. So, I’m just wondering what I may be missing in my code that allows one or the other to be there. Here is the code of my custom template page:
<?php /** * Template Name: Page of Posts * * for a child theme of Twenty_Twelve */ get_header(); ?> <div id="primary" class="site-content"> <div id="content" role="main"> <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args= array( 'category_name' => 'Uncategorized', // Change this category SLUG to suit your use; or see for query parameters http://codex.wordpress.org/Class_Reference/WP_Query#Parameters 'paged' => $paged, 'posts_per_page' => 3, 'post_type' => 'post', ); query_posts($args); if( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <h1 class="entry-title"> <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a> </h1> </header><!-- .entry-header --> <div class="entry-summary"> <!-- Adds the 140x140 thumbnail/featured image --> <div class="excerpt-thumb"> <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"> <?php the_post_thumbnail('excerpt-thumbnail', 'class=alignleft'); ?> </a> </div> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <footer class="entry-meta"> <?php twentytwelve_entry_meta(); ?> <?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?> </footer><!-- .entry-meta --> </article><!-- #post --> <?php comments_template( '', true ); ?> <?php endwhile; // end of the loop. ?> <?php twentytwelve_content_nav( 'nav-below' ); ?> <?php else : ?> <article id="post-0" class="post no-results not-found"> <header class="entry-header"> <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1> </header> <div class="entry-content"> <?php the_post_thumbnail(); ?> <p><?php _e( 'Apologies, but no results were found. Perhaps searching will help find a related post.', 'twentytwelve' ); ?></p> <?php get_search_form(); ?> </div><!-- .entry-content --> </article><!-- #post-0 --> <?php endif; wp_reset_query(); ?> </div><!-- #content --> </div><!-- #primary -->
The topic ‘Excerpt not showing […]’ is closed to new replies.