Skip Navigation

[Resolved] Inserting and showing shortcodes

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

Problem: I am using a 3rd-party plugin to create graphics and charts, and the plugin provides a shortcode system for displaying these charts. I have unique shortcodes for each post, and I would like to know how best to store and display these unique shortcodes for each post.

Solution: The best way to handle this is to create a custom WYSIWYG field for this post type and insert the custom shortcode for each post in the WYSIWYG field. Display the WYSIWYG field by placing a Single Field block in the Content Template for this post type. Select the WYSIWYG field as the dynamic source for this block.

This support ticket is created 3 years, 2 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by yueh-fengC 3 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#2163925

I'm currently building a real estate web and there are some plugin that create beautiful Line and Pie chart, but it is insert using shortcodes.
If I want to show 1 graph in 1 property, another graph in another property (all different, because I'm trying to show the different price history)

Can I do it by creating "Custom fields" of shortcodes in my property? will it work? if it doesn't, is there an alternative way for me to do so...?

please help. thank you so much!

#2163953
1-wysiwyg.png
2-field-value.png
3-template.png
4-front-end.png

Hello, normally the best way to include a different shortcode for each post is to utilize a custom WYSIWYG field. In each post, you can insert a unique custom shortcode in the WYSIWYG field. To display the custom graphics, insert the WYSIWYG field in the post template and the unique custom shortcode will be rendered on the front-end. I am attaching some screenshots here showing the process in some more detail.
1 - I have created a custom WYSIWYG field for "Books" posts
2 - In each Book post, I have inserted a unique custom shortcode in my WYSIWYG field
3 - In the Content Template for all Books posts, I have inserted my WYSIWYG field using a Single Field block
4 - When visiting a Book post on the front-end of the site, the unique custom shortcode from my WYSIWYG field is rendered as a custom graphic (this is just a demonstration, not a real shortcode).

Let me know if this will not work for your needs, and we can try to find another solution.

#2164029

My issue is resolved now. Thank you!