Featured Posts Widget, Excerpts, and "Read More"

Community Forums Forums General Discussion Featured Posts Widget, Excerpts, and "Read More"

This topic is: resolved

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

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

    electricbrick
    Participant
    Post count: 62

    I have a scenario where I absolutely need to use excerpts with the Featured Posts Widget, and need the “Read More” link to appear below the excerpt in the widget. I’ve attempted to use this snippet to add the perplexingly absent “Read More” link to my excerpts. Unfortunately, it doesn’t seem to work.

    I’ve tried using Featured Posts Widget Amplified to no avail. I’ve also looked through the code in the default and Amplified widgets to try to locate the proper hook or filter to add this to, but I still have no clue what to modify. Is it even possible?

    #50391

    Anita
    Blocked
    Post count: 7712

    Can you provide a link to your website with the “snippet” you used from Travis in place?

    #50397

    Doak Heggeness
    Participant
    Post count: 140

    Give this one a spin. It may need to be styled.

    /* Add Read More to Excerpts */
    function excerpt_read_more_link ( $output ) {
     global $post;
     return $output . '<a href="'. get_permalink($post->ID) . '"> Read More...</a>';
    }
    add_filter( 'the_excerpt', 'excerpt_read_more_link' );

    Doak Heggeness, WordPress Development | Website

    #50460

    electricbrick
    Participant
    Post count: 62

    @anitac — sorry I couldn’t, need to keep this site private for the time being (thus making seeking help extra difficult). However…

    @Doak — that worked perfectly!

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

You must be logged in to reply to this topic.