Skip Navigation

[Resolved] best solution for add a shortcode in all pages

This thread is resolved. Here is a description of the problem and solution.

Problem:

What is the best solution for add a shortcode that contains a value that can be added to any page of the site?

Solution:

In most theme, there should be a widget can display in all of your website pages, for example WordPress default theme 2020, you can try these:

1) Dashboard-> Toolset-> Content Templates, Create a content template "my-ct", display the text and value you want:

https://toolset.com/glossary/template/

2) Dashboard-> Appearance-> Widgets, in the Footer sidebar, you can add a text widget, and display above content template's shortcode:

[wpv-post-body view_template="my-ct"]

Relevant Documentation:

https://wp-types.com/documentation/user-guides/views-shortcodes/#wpv-post-body

This support ticket is created 3 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by stephaneM-4 3 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#1733581

What is the best solution for add a shortcode that contains a value that can be added to any page of the site?

The idea is to duplicate a site and I'd like to change the value so that it changes on all the pages of the site that use the shortcode.

Thanks

#1734119

Hello,

In most theme, there should be a widget can display in all of your website pages, for example WordPress default theme 2020, you can try these:
1) Dashboard-> Toolset-> Content Templates, Create a content template "my-ct", display the text and value you want:
https://toolset.com/glossary/template/

2) Dashboard-> Appearance-> Widgets, in the Footer sidebar, you can add a text widget, and display above content template's shortcode:
[wpv-post-body view_template="my-ct"]
hidden link

#1734955

Hello,

I tried your method, it works but the integration of keywords in the text makes a line jump. I would like to add the keywords of the variables in texts that are in all the site.
Do you have a solution that allows you to integrate the keywords directly into the text without skipping lines?

#1735349

How and where do you setup the "integration of keywords", with custom codes or other plugins? please provide detail steps to duplicate the same problem, I need to test it in my localhost, thanks

#1736587

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.