WordPress.org

Ready to get started?Download WordPress

Forums

Summaries on Homepage, not site-wide (5 posts)

  1. C.Flores47
    Member
    Posted 1 year ago #

    So on my blog, the goal is to show summaries on the homepage, then obviously when you click to read the individual post, it displays the full text.

    My index php calls upon 'loop.php' so this code below is in loop.php.

    <div class="entry-content">
    						<?php the_excerpt( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'boilerplate' ) ); ?>
    						<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'boilerplate' ), 'after' => '</div>' ) ); ?>
    					</div><!-- .entry-content -->
    				<?php endif; ?>

    When I change, 'the_excerpt' to 'the_content' it changes to full length, across the whole site. When this is on 'the_excerpt' it changes the whole site to only showing excerpts, even when I click on the single post.

    Is there a final command that I can input to fix this temporarily until I can find the root of this?

    Thanks!

  2. Aaron T. Grogg
    Member
    Posted 1 year ago #

    @C.Flores47:

    hmmm... i'm not experiencing the same result...

    in loop.php, if i change line 138 from:
    <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'boilerplate' ) ); ?>
    to:
    <?php the_excerpt(); ?>
    i get an excerpt on my home page, and the full content on the single page...

    are you using any plug-ins?

    keep me posted, please,
    Atg

  3. Aaron T. Grogg
    Member
    Posted 1 year ago #

    @C.Flores47:

    and another option for getting excerpts on the home page would be to alter line 132, adding || is_home() to that if statement.

    and yet another, is to use the <!--more--> tag in your actual posts, which lets you more finely tune where your posts cut off, but also means doing that in every post...

    Atg

  4. C.Flores47
    Member
    Posted 1 year ago #

    Thanks Aaron! adding 'is_home' worked like a charm and will be perfect until I can look into this a little more.

    Still, it's weird that you had success with the first method because I still cannot get that to work properly. It's still changing the whole site one way or the other, there is no in between. Also it's a local testing environment so there are no additional features,plugins, etc...

    Thanks again though!

  5. Aaron T. Grogg
    Member
    Posted 1 year ago #

    @C.Flores47:

    Well, glad that worked for you.

    Atg

Topic Closed

This topic has been closed to new replies.

About this Topic