• I have a question, concerning the homepage my blog:
    http://www.kittyarends.nl/ayeartolive

    I would like to have only title + excerpts showing on the homepage, as opposed to one post in its entirety and the rest just excerpts with a ‘read me’ button.

    Something did change, but now, the homepage only shows one post (not the most recent, but only the oldest one) as an excerpt, but without the ‘read me’ button.

    What can i do in order to have my homepage show at least 5 posts, with only the title+excerpt AND still showing a ‘read me’ button?

    Thanks for your help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Kathryn Presner

    (@zoonini)

    To display excerpts with each post instead of just the first, the instructions for a child theme are here:

    http://wordpress.org/support/topic/how-to-show-only-post-titles-on-home-page?replies=5#post-5530934

    To add the Read more button as well as the excerpt, you can insert some additional code in your child theme’s content.php file, after this line:

    </div><!-- .entry-content -->

    Here’s the code to add:

    <div class="entry-permalink">
     <a class="more-link" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php _e( 'Read', 'bushwick' ); ?></a>
    </div><!-- .entry-permalink -->

    To figure out why your site is only displaying one post, you could try undoing what you did in your child theme’s template files and starting over.

    Also keep in mind that in your child theme’s style.css, you should only be placing the CSS which you’re changing. Right now, it looks like you’ve pasted in most of the parent’s CSS styles, but child themes only need the pieces of CSS which override the styles in the parent theme.

    Thread Starter katjavogel

    (@katjavogel)

    Hi Kathryn,

    Thanks for your help! The ‘read me’ button works fine now.
    But the homepage still shows only 1 post.

    I did everything you said, including starting all over again, setting up a new child theme, with a blanc style.css file.

    Maybe something is wrong in my index.php file?
    The code in my index.php file now reads:

    get_header(); ?>

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

    <?php
    get_template_part( ‘navigation’ );

    if ( have_posts() ) :
    the_post();

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

    while ( have_posts() ) :
    the_post();

    get_template_part( ‘content’ );
    endwhile;

    bushwick_paging_nav();

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

    </main><!– #main –>
    </div><!– #primary –>

    <?php get_footer();

    Moderator Kathryn Presner

    (@zoonini)

    But the homepage still shows only 1 post.

    How many posts do you have set under Settings > Reading, “Blog pages show at most”?

    Thread Starter katjavogel

    (@katjavogel)

    It’s set to show at most 10.

    The problem occurs after applying these instructions:
    Change line 29 from this:

    get_template_part( ‘content’ );

    to this:

    //get_template_part( ‘content’ );

    The two slashes in front of the line mean that you’re commenting out that part of the code, rendering it inactive.

    Next, change line 34 from this:

    get_template_part( ‘content’, ‘preview’ );

    to this:

    get_template_part( ‘content’ );

    Moderator Kathryn Presner

    (@zoonini)

    Here is what my child theme looks like:

    Bushwick Child 3 1 0 0 by Anonymous tagline

    Here’s the contents of index.php from my child theme:

    http://pastebin.com/8r5BMra9

    And here’s content.php:

    http://pastebin.com/vmk69nqp

    Hope that helps you sort it out! Let me know how it goes.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘titles excerpts with 'read me' button on homepage’ is closed to new replies.