Skip Navigation

[Resolved] Adding paragraphs to WYSIWYG field

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

Problem:

The issue here is that the user's WYSIWYG field is not creating the auto paragraphs.

Solution:

Actually the WYSIWYG field does create the paragraphs automatically and it could be that you have set your content template to not display the auto paragraphs.

This support ticket is created 6 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 2 replies, has 2 voices.

Last updated by Ian 6 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#873070

Ian

I have a custom field called "full-description" that is a WYSIWYG field. I need to have paragraphs so I added the following code modified from the example provided here: https://toolset.com/forums/topic/no-paragraphs-in-text-from-the-wysiwyg-editor/

/* @Recreate the default filters on the_content
-------------------------------------------------------------- */
add_filter( 'meta_content', 'wptexturize'        );
add_filter( 'meta_content', 'convert_smilies'    );
add_filter( 'meta_content', 'convert_chars'      );
add_filter( 'meta_content', 'wpautop'            );
add_filter( 'meta_content', 'shortcode_unautop'  );
add_filter( 'meta_content', 'prepend_attachment' );
 
function my_meta_func( $atts ) {
extract( shortcode_atts( array(
'field' => 'full-description',
), $atts ) );
$text = get_post_meta($post->ID, $field, true);
return apply_filters('meta_content',$text);
}
add_shortcode('my-meta', 'my_meta_func');

When I add the shortcode [my-meta field="full-description"] I get no results.

#873783

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screen Shot 2018-05-10 at 3.05.49 PM.png

Hi Ian,

I'm not sure what you mean by you need to have paragraphs as the WYSIWYG field should already add using an automatic paragraph.

It could be that you have auto paragraphs disabled on your content template. If so please enable auto paragraphs. See Screenshot.

Thanks,
Shane

#873802

Ian

OK, I usually turn that off in order to avoid unwanted auto paragraphs.