Site logo

Archived topic

Dynamic Content Suffix

7 replies · Started by VDSolutions on April 16, 2021

Viewing posts 1–8 of 8

Hello, I'm trying the new feautures of gp premium but there is a thing that really annoys me.
You can add text before the post meta data but you can't add after it.

https://prnt.sc/11jb8c8

I'm wondering if there is a way to do this manual or if it's gonna be easy to add the opposite function by myself.

Thanks in advance.

Hi there,

Can't see too many usages of the after text suffix but I could be wrong.

Can you link me to the page in question?

We can likely achieve it with some CSS.

I second this... there are many cases where I'd want to add text before AND after what's in the post title. Elementor has this functionality, and would love if you guys added it as well!

Hi there,

that is something we're looking at adding in a future update.

I agree, I am trying to create a dynamic "location page" template for our service areas to help with SEO and would love to be able to add the dynamic tag BEFORE the rest of the title.

e.g. Page 1: <Dynamic Tag "Australia"> Mobile Physiotherapy Service.
Page 2: <Dynamic Tag "New Zealand"> Mobile Physiotherapy Service.

Is there anyway to achieve this with CSS? OR another way to achieve this? I am looking at creating up to 50 location pages, and this would speed the process up massively :)

Thanks in Advance!

Alex

Hi Alex,

Is there anyway to achieve this with CSS? OR another way to achieve this? I am looking at creating up to 50 location pages, and this would speed the process up massively

We can dynamically add the value using PHP snippets hooking dynamic variables on CSS properties on the wp_head of the site.

Say, for example, you have an ACF field for a dynamic tag you want to put as suffix of entry-title.

add_action('wp_head',function(){
$suffix = get_field('your_suffix_tag_field');
echo '<style> .entry-title:before{ content:"'.$suffix.' "}</style>';
});

Now this is full PHP manual coding.

You can skip the add_action() and actually add display rule location conditions if you do this on a Hook Element.
https://docs.generatepress.com/article/hooks-element-overview/

It still requires a bit of CSS and PHP but it can be more simplified. :D

Any update here? Still need dynamic content suffix option...

Any work around until ya'll add it?

Thanks

Hi Shane,

The PHP code I've provided on my previous reply is a workaround.

It can be modified to fit your specific purpose. We just need to change the selector added in it.

Can you open a new topic and provide the details of the site and the part to apply it on? So I can inspect the page and modify it for you. :)

This archived topic is closed to new replies.