Site logo

Archived topic

Dynamic Text Replacement

6 replies · Started by John on March 12, 2021

Viewing posts 1–7 of 7

Morning guys,

Any plans to add Dynamic Text Replacement functionality to the GeneratePress theme and/or GP Premium plugin?

Thanks & Regards
John

Hi David

Sounds like an interesting release although not yet sure how it will work in my case.

I use GP to create landing pages for Google search ads. To increase ad relevancy and landing page relevancy, I want to use a dynamic text replacement function so that the landing page title reflects the keyword entered searched for in Google.

Best Regards
John

Unfortunately not at this time - not something we had considered within the theme or GP Premium - i am not sure the best method on how we would integrate this - i suppose if we can get a UTM from the browser URL then a dynamic replacement could be performed.... i'll see what Tom has to say.

Thanks for looking into it, David. Will await any development with great interest.

Definitely interesting - we'll be talking internally ... thanks for the headsup!

Hi there,

Are these parameters in the URL? If so, it wouldn't be too hard to do right now..

For example, if you're using the block editor, you could do this:

add_filter( 'render_blocks', function( $content ) {
    $text_to_replace = isset( $_GET['my-param'] ) ? $_GET['my-param'] : false;
    $text_to_look_for = '{{replace_me}}';

    if ( $text_to_replace ) {
        $content = str_replace( $text_to_look_for, esc_html( $text_to_replace ), $content );
    }

    return $content;
} );

Just a very basic example :)

This archived topic is closed to new replies.