Support » Theme: Customizr » more text link on blog excerpts

  • Resolved andrew55

    (@andrew55)


    On our blog homepage, the excerpts and feature images display fine for all the posts.

    I’m concerned that some users might not realize to click the title or image to get to the individual posts.

    On the main blog home page, Is there a feature or method available to insert a “read more” button or text link under each text excerpt which leads to the individual post?

Viewing 9 replies - 1 through 9 (of 9 total)
  • HI: andrew55 i am also looking for this solution what is your site link?

    Thread Starter andrew55

    (@andrew55)

    HI: andrew55
    Please try the following in your child theme functions.php
    https://codex.wordpress.org/Customizing_the_Read_More#Modify_The_Read_More_Link_Text

    Thread Starter andrew55

    (@andrew55)

    zeshankhanbwp – thanks. I’ve been reviewing this reference for a few days.

    But Customizr seems to somehow create its own excerpt without a “read more” link or button, at a certain number of characters.

    Still not sure how to get my own “read more” link to show on blog home page.

    Hi andrew55,
    Add this code to your child theme’s functions.php.

    function wpdocs_excerpt_more( $more ) {
        return '[...More]'; /*CHANGE TO SUIT YOUR NEEDS */
    }
    add_filter( 'excerpt_more', 'wpdocs_excerpt_more' );
    Thread Starter andrew55

    (@andrew55)

    Menaka,

    Thanks for the reply and the function. It does work great at changing more text.

    Any ideas on how to get this to be a link that goes to the individual post, so when visitor clicks it, it opens up to the desired post?

    As of now, on our blog, it’s just text with no link.

    Hi,
    Please remove the code that I gave earlier.
    Try adding this code for a Read More button

    function new_excerpt_more($more) {
           global $post;
    	return ' <a class="moretag btn btn-primary" href="'. get_permalink($post->ID) . '">Read More »</a>';
    }
    
    add_filter( 'excerpt_more', 'new_excerpt_more' );

    Or this for a Read More link.

    function new_excerpt_more($more) {
           global $post;
    	return '<a class="moretag" href="'. get_permalink($post->ID) . '"> Read More...</a>';
    }
    
    add_filter( 'excerpt_more', 'new_excerpt_more' );

    Thread Starter andrew55

    (@andrew55)

    That works great. Thank you very much for you time. I think many Customizr blogs will benefit from your function.

    Menaka S. This function also works great for me thanks so much…

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘more text link on blog excerpts’ is closed to new replies.