Skip Navigation

[Resolved] Adding HTML markup to CPT description

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 emilyT 3 years, 4 months ago.

Assigned support staff: Minesh.

Author
Posts
#627941

Hi folks

I've used the shortcode given in this thread to add a CPT description to its archive page: https://toolset.com/forums/topic/how-do-i-show-the-post-type-description-in-a-post-type-archive/

What I would like to do is mark up the description with paragraphs and other HTML to format it on the page. However, at the moment the tags are being rendered on the page - see here hidden link (scroll down to below the images).

Is there any way that I can add markup, or is there another way I can achieve this? I'm looking for a solution that will allow our client to be able to edit the description easily themselves - I think putting it directly in the archive itself would be too confusing for them.

I'll look forward to your response!
Cheers, Emily

#628219

Hi Emily,

Can you try

return html_entity_decode($obj->description);

Thanks.

#628277

Perfect, thanks Mohammed! hidden link

Thanks for your help with this, it's much appreciated.

Best wishes, Emily