WordPress.org

Ready to get started?Download WordPress

Forums

Portfolio Press
[resolved] Show the excerpt, not the whole post (12 posts)

  1. Jose B
    Member
    Posted 4 months ago #

    On my blogroll I don't want the entire post to show. I simply want the excerpt to show.

    I have the latest version of WP and PP.

    I have "excerpt" selected in my Reading Settings, but that didn't change anything.

  2. salsaturation
    Member
    Posted 4 months ago #

    Please note that Settings > Reading > 'For each article in a feed, show' that refers to feeds (RSS) only and has nothing to do with blog post.

    If you haven't done so yet you need to create a Child_Themes and copy over the relevant template (most likely it is index.php or archive.php) then find

    the_content()

    and replace it with

    the_excerpt()

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

  3. Jose B
    Member
    Posted 4 months ago #

    Thank you salsaturation. I probably should have known what the Setting > Reading > settings do. My bad.

    I do have a child theme, but I could not find

    the_content()

    in my index.php file.

    It says this:

    <?php
    /* 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', get_post_format() );
    ?>
  4. salsaturation
    Member
    Posted 4 months ago #

    sorry ignore index.php (delete it from the child theme if you havent edited it). Copy over content.php and edit line 45

    from

    <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'portfoliopress' ) ); ?>

    to

    <?php the_excerpt( __( 'Continue reading <span class="meta-nav">→</span>', 'portfoliopress' ) ); ?>

  5. Jose B
    Member
    Posted 4 months ago #

    Okay that almost did the trick.

    But now the "featured image" isn't displaying for posts. Only the title and excerpt show.

    Thank you for all your help so far.

  6. Jose B
    Member
    Posted 4 months ago #

    Not to question your expertise, but are you sure that -> isn't supposed to be =>?

  7. salsaturation
    Member
    Posted 4 months ago #

    Not to question your expertise, but are you sure that -> isn't supposed to be =>?

    yes you are right - the editor here changed it. Actually all you needed to amend was replace the_content with the_excerpt the excerpt - everything else remained the same.

    Add <div class="featured-image"></class><?php the_post_thumbnail(); ?></div> to line 45 so your code will look like

    <div class="featured-image"></class><?php the_post_thumbnail(); ?></div><?php the_excerpt( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'portfoliopress' ) ); ?>

  8. salsaturation
    Member
    Posted 4 months ago #

    the editor is playing up - so note that the only thing that has changed is

    <div class="featured-image"></class><?php the_post_thumbnail(); ?></div><?php the_excerpt

  9. Jose B
    Member
    Posted 4 months ago #

    Man you've been super helpful, dude. Thanks a lot!

    Last question I swear?

    The post thumbnail shows (thank you again), but it's not clickable. Like the headline, I'd like the user to be able to click on the image and get to the post. Any way to make this happen?

  10. Devin Price
    Member
    Theme Author

    Posted 3 months ago #

    Sorry I didn't see this thread earlier. An easier option would probably be to use the "More Tag": http://en.support.wordpress.com/splitting-content/more-tag/

  11. salsaturation
    Member
    Posted 3 months ago #

    The post thumbnail shows (thank you again), but it's not clickable. Like the headline, I'd like the user to be able to click on the image and get to the post. Any way to make this happen?

    This should work

    <a href="<?php the_permalink() ?>"><?php the_post_thumbnail(); ?></a>

  12. Jose B
    Member
    Posted 3 months ago #

    Worked like a charm salsaturation. Thank you for all your accurate help.

Reply

You must log in to post.

About this Theme

About this Topic