Skip Navigation

[Resolved] Adding a link in the body field for a specific post type prevents body appearing

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

Problem:

The issue here is that when a user uses a conditional on a WYSIWYG field, the results return empty if there is a link in the field.

Solution:

This was because the user was doing the conditional statement incorrectly. The correct way can be seen in the link below

https://toolset.com/documentation/user-guides/conditional-html-output-in-views/using-custom-functions-in-conditions/#checking-for-empty-post-content

This support ticket is created 6 years, 5 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 4 replies, has 2 voices.

Last updated by josephQ 6 years, 5 months ago.

Assisted by: Shane.

Author
Posts
#955646

This is a very peculiar error, but I have reproduced it consistently.

For a specific Custom Post Type on my site, Person, if I add a hyperlink in the body field, the body field will be output as an empty string.

Example page: hidden link

Note: the page does not have a link on it because I want the body field to appear.

If you edit the page and add a link, the body field will not appear on the front-end. (Yes, if you look at the Layout template, you'll see a conditional statement that says, "If the body isn't empty, display 'Bio' and the post body." But it shouldn't fail this test!)

#955702

Shane
Supporter

Languages: English (English )

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

Hi Joseph,

Thank you for contacting our support forum.

I was able to see the issue.

Could you try downloading the latest version of our Types plugin and let me know if the issue still remains?
https://toolset.com/account/downloads/

Thanks,
Shane

#955756

Shane,

Thanks for your response.

I've updated Toolset Types to 3.0.6, and this issue is still unresolved.

What's the next step?

#956556

Shane
Supporter

Languages: English (English )

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

Hi Joseph,

I see that you have a conditional that checks the post body.

Actually to check the post body since its in a WYSIWYG field then this method wouldn't work and it could be why its breaking when a link is added.
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/using-custom-functions-in-conditions/#checking-for-empty-post-content

Please try this and let me know if the issue still remains.

Thanks,
Shane

#956715

Shane,

Thanks for your note. This did the trick.

Thanks!