Skip Navigation

[Resolved] Taxonomy term description is not wrapped in tags

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

Problem:
The user is using a plugin to edit a taxonomy description in a WYSIWYG editor. The result on the frontend is not wrapped in paragraphs(

tags).

Solution:
WordPress, by default, does not support a classic editor for the description of a custom taxonomy term. I think that you are using a plugin that converts the default textarea to a classic editor for the taxonomy description.

The classic editor does not actually save the content with

tags. Themes use WordPress function to convert double return lines into a paragraph using the function wpauto

Toolset shortcode does not use the function to wrap paragraphs in

tags. We will need a custom shortcode that will do that for us. As this is intended for the archive page, we can use WordPress function term_description that do wrap paragraphs into

tags.
We can build a shortcode with custom code in the theme functions.php file:

function term_description_with_paragraphs() {
    return term_description();
}
add_shortcode( 'term_description_with_p', 'term_description_with_paragraphs' );

Then use the shortcode [term_description_with_p] instead of [wpv-taxonomy-description].

Relevant Documentation:

This support ticket is created 4 years, 6 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: Africa/Casablanca (GMT+01:00)

This topic contains 2 replies, has 2 voices.

Last updated by DaveR6137 4 years, 6 months ago.

Assisted by: Jamal.

Author
Posts
#1613589

Another clue to the rendering not being quite right is the Snowdonia screenshot - you can see the category description to the left is rendering the text as a single block - this is 3 paragraphs.. The Visual Cell to the right is OK.. I've added these extra sections so the taxonomy looks near to what the final product will be and it's better to spot any issues now than later.

#1614133

Hello,

WordPress, by default, does not support a classic editor for the description of a custom taxonomy term. I think that you are using a plugin that convert the default textarea to a classic editor for the taxonomy description.

The classic editor does not actually save the content with <p> tags. Themes use WordPress function to convert double return lines into a paragraph using the function wpauto
https://developer.wordpress.org/reference/functions/wpautop/

Toolset shortcode does not use the function to wrap paragraphs in <p> tags. We will need a custom shortcode that will do that for us. As this is intended for the archive page, we can use WordPress function term_description that do wrap paragraphs into <p> tags.
We can build a shortcode with custom code in the theme functions.php file:

function term_description_with_paragraphs() {
	return term_description();
}
add_shortcode( 'term_description_with_p', 'term_description_with_paragraphs' );

Then use the shortcode [term_description_with_p] instead of [wpv-taxonomy-description].

I hope this helps. Let me know your feedback.

#1614525

My issue is resolved now. Thank you!