Skip Navigation

[Resolved] conditional test of the post content in my custom field

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

Problem:

I am having an issue trying to output a phrase instead of empty content when the body (content) of my custom post is empty.

Solution:

To check whether the content is empty and output the desired phrase, refer to the following documentation:

Relevant Documentation:
https://toolset.com/forums/topic/conditional-output-if-the-post-content-is-filled/

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 martinE-4 1 year, 9 months ago.

Assisted by: Christopher Amirian.

Author
Posts
#2556881

Tell us what you are trying to do?
Trying to output a phrase instead of empty content when the body (content) of my custom post is empty

Is there any documentation that you are following?
Just trying to use the wpv-conditional in legacy views:

Here is what I am trying and it is displaying nothing:

 [wpv-conditional if="([wpv-post-body view_template="None"] ne '')"]
     [wpv-post-body view_template="None"][/wpv-conditional]
       [wpv-conditional if="([wpv-post-body view_template="None"] = '')"]
      No abstract available but the full text is online at the title link below.[/wpv-conditional]  

The shortcode:

[wpv-post-body view_template="None"]

on its own seems to work fine and displays the content ok. Just want to output the phrase "No abstract available but the full text is online at the title link below." when the body is empty.

#2557509

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

The correct way of checking whether the content is empty is as follows:

https://toolset.com/forums/topic/conditional-output-if-the-post-content-is-filled/

Thank you.

#2557563

My issue is resolved now. Thank you! Thanks for pointing me in the right direction!