Skip Navigation

[Resolved] Using fields and text block

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

Problem:

A user reported that he is trying to show the Types Fields shortcode values within the paragraph tag, but the "Fields and Text" blocks seem to strip the paragraph tag.

Solution:

Guided that this is something related to WordPress and if a paragraph contains only a shortcode, the paragraph tags around the output are stripped.

As a workaround, one can wrap the Types field shortcode inside the "wpv-autop" shortcode.

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-autop

This support ticket is created 2 years, 9 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: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by matthewW-12 2 years, 9 months ago.

Assisted by: Waqar.

Author
Posts
#2320987
back end.png
front end.png

Tell us what you are trying to do?
Display custom field data within p elements

What is the link to your site?
hidden link

With the fields and text block, on the back end, a p element encloses the field data, which is what I want. However, on the front end, a div encloses the field data, and there is no p. Is there a way to control this?

#2322489

Hi,

Thank you for contacting us and I'd be happy to assist.

This is something related to WordPress and if a paragraph contains only a shortcode, the paragraph tags around the output are stripped.
(you'll see the same behavior in the core classic or custom HTML blocks)

As a workaround, you can wrap the field shortcode inside the "wpv-autop" shortcode, for example:
( ref: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-autop )


[wpv-autop][types field='languages' separator=', '][/types][/wpv-autop]

regards,
Waqar

#2324947

My issue is resolved now. Thank you!