• Resolved tophiebearrr

    (@tophiebearrr)


    Im using an altered version of twentythirteen theme, and the way it displays posts is that it puts the entire post in the feed. I made a change to the file and replaced content with excerpt (would have to look again to determine the exact file I changed) so that the posts would display a [continue reading] link to the rest of the post.

    However, Im noticing that the change I did means that the post will always display the excerpt only, so when clicking on a post to go to the page, it still only displays the excerpt and thus is affecting the theme in entirety.

    Does anyone have a suggestion on how to fix this so that my main feed shows the excerpt, but when clicking on the title of a post you can view the entire post?

    Link at: smattering.com.au

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Make sure you’re still using the_content() in single.php, which is the file WP uses to display a specific post. It sounds like you’ve accidentally changed it to excerpt there as well as wherever you intended to change it.

    Thread Starter tophiebearrr

    (@tophiebearrr)

    I fixed it, thats what I did, only in the content.php

    Do you have any suggestion as to how I would have it so that on the homepage, It displays excerpts until clicking on the title to view the entire post?

    thanks for your help

    Oops sorry, this is what I get for replying to threads while tired. In your content.php find this code:

    the_content( sprintf(
      __( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'twentythirteen' ),
      the_title( '<span class="screen-reader-text">', '</span>', false )
    ) );
    
    wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) );

    And replace it with:

    if( is_single() ) {
      the_content( sprintf(
        __( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'twentythirteen' ),
        the_title( '<span class="screen-reader-text">', '</span>', false )
      ) );
    
      wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) );
    } else {
      the_excerpt();
    }

    That should do it.

    Thread Starter tophiebearrr

    (@tophiebearrr)

    No worries, that did the trick! thank you so much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Excerpt issue affecting global instead of post’ is closed to new replies.