Skip Navigation

[Resolved] How do I add custom class or id to a Content Template?

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

Problem:

How to add custom class or ID to the content template.

Solution:

If you are using blocks editor, you can try Toolset container block, see our document:

Relevant Documentation:

https://toolset.com/course-lesson/container-blocks/

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 2 replies, has 2 voices.

Last updated by marcusC-4 3 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#2146273

I am displaying a content template within a View loop. The template displays as expected, but I don't see any way to add a custom class or ID to the content template. I need that in order to customize the styling.

You can see the content template within the loop on this page. The posts that are "Sermons" are using the content template: hidden link

#2146485

Hello,

The Toolset content template does not apply any CSS class or ID, you can setup them into the content template, for example:
If you are using classic editor, you can use a HTML div tag to wrap all other content, like this:

<div class="xxx">...</div>

If you are using blocks editor, you can try Toolset container block, see our document:
https://toolset.com/course-lesson/container-blocks/

#2146655

Easy! This is my first foray with the Toolset Blocks and I didn't know yet about the Container Block. I'm loving the new block editor. I also didn't realize that I could switch back to Classic Editor and use the old way of doing things if needed.

Thanks for the insights and info.