Site logo

[Resolved] Read more Button on Blog-Site sometimes visible, sometimes not

Home Forums Support [Resolved] Read more Button on Blog-Site sometimes visible, sometimes not

Home Forums Support Read more Button on Blog-Site sometimes visible, sometimes not

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2466986
    Stephan

    Hello together, I have the following phenomena:

    I have around 50 Blog posts. On the Blog-site itself, I show 9 Excerpts per page. First site is fine, after this, the read more buttons not always being shown.

    What can I do to get them on all excerpts shown?

    Thanks in advance for your help,

    Stephan

    #2467173
    Stephan

    I solved the problem now, reading another article with same problem.

    Now I only have the last problem, that some buttons show “lees meer” (wanted) and the buttons, which are now shown too after putting code in the function.php, have the title “weiterlesen” (translation from the original read more). How I can change all to “lees meer”?

    The code I put into the function.php:

    add_filter( ‘wp_trim_excerpt’, ‘tu_excerpt_metabox_more’ );
    function tu_excerpt_metabox_more( $excerpt ) {
    $output = $excerpt;

    if ( has_excerpt() ) {
    $output = sprintf( ‘%1$s <p class=”read-more-button-container”>%3$s</p>’,
    $excerpt,
    get_permalink(),
    __( ‘Read more’, ‘generatepress’ )
    );
    }

    return $output;
    }

    #2467413
    Ying
    Staff
    Customer Support

    Hi Stephan,

    Try changing your PHP code to this:

    add_filter( 'wp_trim_excerpt', 'tu_excerpt_metabox_more' );
    function tu_excerpt_metabox_more( $excerpt ) {
        $output = $excerpt;
    
        if ( has_excerpt() ) {
            $output = sprintf( '%1$s <p class="read-more-button-container"><a class="button" href="%2$s">%3$s</a></p>',
                $excerpt,
                get_permalink(),
                "Lees meer"
            );
        }
    	
        return $output;
    }
    #2467998
    Stephan

    Thank you so much Ying, this works fine now 🙂

    #2468564
    Ying
    Staff
    Customer Support

    Glad to hear that 🙂

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