Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Read More Doesn’t Link

  • You’re welcome, Tawna!

  • GP Team,

    The code you provided to fix this conflict between GP and WP has quit working. Please help.
    Thank you.

  • Anything change on the site? e.g is the code still active on the site or any plugin or other updates ?

  • Hi David,

    No nothing has changed and yes the code is still active on the site. No updates, etc.

    It actually isn’t working on any of the sites I had to add it to so something happened with it.

  • What other information do you need so this can be fixed?
    Thank you.

  • Hi Tawna,

    Can you re-share a link to a Blog page on a site of yours where the code isn’t working?

  • I see. Do you have a staging/test site where this issue is occurring as well? If so, can you provide login credentials to it through the Private Information field so we can check why the code isn’t working?

  • Hi – I sent over the login for 3 sites it isn’t working on – did you get them? Thank you

  • No, we don’t see the site links. Can you check again in the private info field?

  • Admin login credentials attached again – please let me know if you received them this time. Thank you!

  • Hi Tawna,

    Can you try adding this snippet as well?:

    add_filter( 'render_block', function( $block_content, $block ) {
        if ( !is_admin() && ! empty( $block['attrs']['className'] ) && strpos( $block['attrs']['className'], 'wp-block-post-excerpt__excerpt' ) !== false ) {
    		$myreplace = 'Read More';
    		$myinsert = sprintf( '<span><a href="%1$s">%2$s</a></span>',
                get_permalink(),
                __( 'Read more', 'generatepress' )
            );
            $block_content = str_replace( $myreplace, $myinsert , $block_content );
        }
    
        return $block_content;
    }, 10, 2 );
  • Thank you Fernando – I added it but it didn’t work.

  • I see. Sorry about that.

    Can you try this?:

    add_filter( 'render_block', function( $block_content, $block ) {
    
        if ( !is_admin() && $block['blockName'] === 'core/post-excerpt'){
    		$myreplace = 'Read More';
    		$myinsert = sprintf( '<span><a href="%1$s">%2$s</a></span>',
                get_permalink(),
                __( 'Read more', 'generatepress' )
            );
            $block_content = str_replace( $myreplace, $myinsert , $block_content );
        }
    
        return $block_content;
    }, 10, 2 );

    I tested this code and it seems to be working.

  • It works …. but check out the page and the hundreds of lines of code before the posts – on the home page and then go to the actual posts pages! (I left it for you to view but will need to remove it soon so my site isn’t so messed up!)
    https://mydogguide.com/
    https://mydogguide.com/how-do-you-know-if-your-dogs-hips-hurt/

  • Oh. I edited the code above.

    Can you update it now? I had a test line in the previous code.

Viewing 16 posts - 49 through 64 (of 80 total)
  • You must be logged in to reply to this topic.