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 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.

This topic contains 2 replies, has 2 voices.

Last updated by marcusC-4 2 months ago.

Assigned support staff: 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

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

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.