Custom "Read More"

Community Forums Forums General Discussion Custom "Read More"

This topic is: not resolved

This topic contains 7 replies, has 5 voices, and was last updated by  Sridhar Katakam 10 months, 2 weeks ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #82950

    scorpio
    Participant
    Post count: 1

    Hi guys,
    I’ve been looking for this but couldn’t find anything to help me.
    I’m trying to customize the “Read More” button on my posts and add the post title next to it so that it says:
    Read more: Post Title

    Any help appreciated :)
    Thanks
    Steve

    #82969

    AC
    Blocked
    Post count: 7712

    Please share a link to your site.

    #83064

    Sridhar Katakam
    Participant
    Post count: 1071
    #85472

    lucaswijntjes
    Participant
    Post count: 8

    I have the same question, and it wish to have it similar as in your example Sridhar. Just like this:

    Continue Reading: “Title of the post”

    (including the “s)

    How would I put this in the functions file? Thanks for your help

    #85479

    Sridhar Katakam
    Participant
    Post count: 1071

    Add this in functions.php:

    //* Modify the Excerpt read more link
    
    add_filter('excerpt_more', 'new_excerpt_more');
    function new_excerpt_more($more) {
    
    	return '... <a class="more-link" href="' . get_permalink() . '">Continue Reading: ' . get_the_title() . '</a>';
    
    }

    #85605

    lucaswijntjes
    Participant
    Post count: 8

    Hi Sridar, thanks for your reply. It wasn’t working, but got me in the right direction. This is working:

    add_filter( 'the_content_more_link', 'sp_read_more_link' );
    function sp_read_more_link() {
    
    	return '... <a class="more-link" href="' . get_permalink() . '">Continue Reading: ' . get_the_title() . '</a>';
    
    }
    
    #88470

    Matt
    Member
    Post count: 1

    This post is extremely helpful! I am customizing my page to something similar. I am trying to customize the code so that instead of “page title” I see the text that was entered into the “more text field” from Genesis Featured Page plugin. Anyone tackle something similar to this?

    #88498

    Sridhar Katakam
    Participant
    Post count: 1071
Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.