Archived topic
automatically add a string to an url in a button
3 replies · Started by Carlo on July 4, 2021
Hi,
I have a GP block element that is showed at the end of about 50 pages.
In this element there is a button. I need this url to point to another website of mine to a specific page, based on the source page.
For example:
domain1/page1 -> domain2/page1
domain1/page2 -> domain2/page2
etc
I am not a programmer, I have thougt that
the button could have a shortcode (or a string anyway) in the url and this string is replaced by a snippet
The url is simply made of 2 parts: static (= domain2/ ) and dynamic (page1, page2 etc)
If I could take the second part either:
- from the url of the page in domain1 (domain1/page1) provided that the 2 sites shares exactly the same page slug
- or from a custom field I can set in each domain1 page
Any idea how I achieve this? :)
Thank you All the best
Hi Carlo,
I feel like this would require a custom solution and don't think GB would be suitable for it.
I would recommend posting the question on a WordPress general forum like this to see if anyone has some ideas on how to achieve it:
https://wordpress.stackexchange.com/
If not then you might need to contact a developer on Codable to create a custom solution for you (see the bottom of this page):
https://generatepress.com/what-support-includes/
Hope this helps to get you started.
Hi Leo,
thank you anyway. I solved it integrating some code here and there :)
Glad to hear :)