Show the _excerpt in related posts

Community Forums Forums Design Tips and Tricks Show the _excerpt in related posts

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  cehwitham 1 year, 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #20287

    aaronsummers
    Participant
    Post count: 5

    I followed the tutorial by Nick the Geek here: http://designsbynickthegeek.com/tutorials/related-posts-genesis

    And have been trying to include the excerpt with the post title and image, but am unable to make it work.

    Would any of your brilliant people have any idea or a simple way to achieve this?

    Thanks in advance.

     

    #22097

    cehwitham
    Participant
    Post count: 396

    If you’ve got it outputing ok and just need to add the excerpt then find the following line:

    $related .= ‘<a href= … …‘;

    and change it to:

    add in get_the_excerpt()

    More information on get_the_excerpt here: http://codex.wordpress.org/Function_Reference/get_the_excerpt


    Twitter: cehwitham Web: cehwitham.com

    #22293

    aaronsummers
    Participant
    Post count: 5

    Brilliant thanks, obvious now I look at it.

    This was the final code:
    $related .= ‘<li><a href=”‘ . get_permalink() . ‘” rel=”bookmark” title=”Permanent Link to ‘ . get_the_title() . ‘”>’ . $img . get_the_title() . ‘</a>’ . get_the_excerpt() . ‘</li>’;

    #22788

    cehwitham
    Participant
    Post count: 396

    Great, glad it’s working for you.


    Twitter: cehwitham Web: cehwitham.com

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.