Skip Navigation

[Resolved] Display a content template with custom fields at bottom of every page

This support ticket is created 4 years, 5 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)

Author
Posts
#1664553

Tell us what you are trying to do?
I am trying to display a Toolset Blocks created content template containing types fields at the bottom of every WordPress Page or WordPress post in my site. I do not want to have to recreate the entire template / theme page in a Toolset Content Template and have the original theme layout be over-ridden. I just want to add my "Info Box" Content Template containing Types Fields that are related to each Post and Page to the bottom of every Post or Page. Can this be done? If so how?

What is best practice or the best approach for displaying a group of Toolset fields of a Custom Post Type in the default WordPress Posts or WordPress Pages?

I am trying to figure out if there is a way to do this quickly and easily without having to recreate the entire WordPress Post or WordPress Page layout in a Content Template.

I would like to create a simple Content Template using Toolset Blocks and have it be displayed at the bottom of EVERY WordPress Page or WordPress Post without the end-user having to manually enter in the Content Template shortcode.

So far the only thing I can think of is to create a View with the Content Template containing the single iteration of fields within it and assign that View to WordPress Posts or WordPress Pages - but then my question becomes how do I position the view in the Page template so it shows up in the same location every time? For instance if I want to display a set of Page or Post specific fields with a designed layout at the bottom of every Page or Post?

Is there any documentation that you are following?
No

Is there a similar example that we can see?
No

What is the link to your site?
The site is not live - it is in development.

#1665123

Hi Andrew,

Thank you for contacting us and I'd be happy to assist.

If you'll not attach a Toolset content template to your posts or pages, the output will be controlled by the theme's template files.

For single posts, it is usually a "single.php" file and for single pages, it is usually a "page.php" file, but different themes can also adopt a different templating structure.

You can learn more about WordPress Template hierarchy from this guide:
https://developer.wordpress.org/themes/basics/template-hierarchy/

Once you're aware of the exact location in the theme's template file, where you'd like to show these related fields data through an "Info Box" content template, you can show that content template's output using the "render_view_template" function:
https://toolset.com/documentation/programmer-reference/views-api/#render_view_template

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1669133

Hi Waqar,

Isn't there an easier way than having to mess with the theme files? Can we use widgets or something? I am willing to attach a content template to a post or page - I just don't want to have to rebuild the entire page if I just want to add a few custom fields to the bottom of an existing page layout...

Does that make my question more clear?

Thanks for your help!

#1669387

Hello,

Yes, it is possible to use WordPress widget to render view or content template, for example, you can add a text widget, and display the content template shortcode:
[wpv-post-body view_template="my-template"]
See our document:
hidden link
Outputs the content of the current post or renders a content template

#1669483

My issue is resolved now. Thank you!