Add Read More link to Custom Excerpts On Home Page

Community Forums Forums Design Tips and Tricks Add Read More link to Custom Excerpts On Home Page

This topic is: not resolved

Tagged: ,

This topic contains 1 reply, has 2 voices, and was last updated by  SoZo 1 year, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #16670

    nikcree
    Participant
    Post count: 7

    I am trying to add a ‘Read More…’ link to excerpts on the home page, but not on any other pages. I am using the Genesis Featured Widget Amplified‘ display page (not post) excerpts. The code I have in my functions.php is:

    <code>

    add_filter( ‘excerpt_more’, ‘moogerah_add_excerpt_more’ );
    function moogerah_add_excerpt_more( $more ) {
    if(is_home()) { // also tried is_front_page()
    $more = ‘…<div class=”readmore”><a href=”‘ . get_permalink() . ‘” rel=”nofollow”>Read More</a></div>’;
    return $more;
    }}

    </code>

    it works without the home of front page conditional but does not work when I add the conditional argument. Any suggestions please?

    Many thanks

    • This topic was modified 1 year, 7 months ago by  nikcree.
    • This topic was modified 1 year, 7 months ago by  nikcree.
    • This topic was modified 1 year, 7 months ago by  nikcree.
    • This topic was modified 1 year, 7 months ago by  nikcree.
    • This topic was modified 1 year, 7 months ago by  nikcree.
    • This topic was modified 1 year, 7 months ago by  nikcree.
    #17493

    SoZo
    Moderator
    Post count: 1573

    I’m seeing a read more currently


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

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

You must be logged in to reply to this topic.