WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] help with 2012 (5 posts)

  1. ndhelp
    Member
    Posted 1 year ago #

    I set up a 2012 child theme. On my homepage, I just want excerpts and an image as a read more link. I changed <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?> to <?php the_excerpt( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?> but when you click on the post title it still only shows the excerpt and not the complete posts. How can I fix?

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    this is because content.php is used for index pages as well as for single posts;

    try to use a conditional statement:

    <?php if( is_home() ) the_excerpt();
    else the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?>

    http://codex.wordpress.org/Function_Reference/is_home

  3. ndhelp
    Member
    Posted 1 year ago #

    Thank you alchymyth, that worked great. I noticed that instead of a read more link there's just [...] and no link. Is there a way to add a 'read more' link?

  4. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

  5. ndhelp
    Member
    Posted 1 year ago #

    Thank you

Topic Closed

This topic has been closed to new replies.

About this Topic