[Support request] Change the Read More to custom text

Home Forums Support [Support request] Change the Read More to custom text

Home Forums Support Change the Read More to custom text

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

    Dear Sir/Madam,

    I have a Query-loop at the home page, I want to change the Read More to custom text, I refer to this article https://generatepress.com/forums/topic/customizing-the-read-more-text-on-all-archive-pages/, below is the code I added to functions.php but none of them work. Could you please advise which filter I should change?

    function modify_read_more_link() {
     return '<a class="more-link" href="' . get_permalink() . '">Continue ...</a>';
    }
    add_filter( 'the_content_more_link', 'modify_read_more_link' );
    
    function new_excerpt_more($more) {
     global $post;
     return '<a class="moretag" 
     href="'. get_permalink($post->ID) . '">Continue ...</a>';
    }
    add_filter('excerpt_more', 'new_excerpt_more');
    
    function excerpt_read_more_link($output) {
        global $post;
        $text = 'Continue ...';
        return $output . '<a class="more-link" href="'. get_permalink($post->ID) . '">'. $text .'</a>';
    }
    add_filter('the_excerpt', 'excerpt_read_more_link');
    #2334058
    David
    Staff
    Customer Support

    Hi there,

    they won’t work with a Query Loop block.
    Instead, select your Excerpt in the Query Loop and disable the default read more option.
    And then add a GB Button, and make that your read more by 1) adding your button label 2) add the Dynamic Link to the Single Post.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.