Skip Navigation

[Resolved] Conditional output not displaying complex content

This support ticket is created 7 years 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 7 years ago.

Assisted by: Nigel.

Author
Posts
#599088

Hello,

I'm building a page in layouts that needs to display a specific content based on the post status (draft, pending review, published). I have this functionality working for simple content (like a single header) but once I add more complex content (headers, links, ul, buttons) the page will fail to load. I've tried to narrow it down to find which elements are causing the issue and it seems that the issue occurs once there is a

    in the content. Any ideas what could be causing this?

    I keep all plugins updated so I don't think its that, fwiw.

    Thanks,
    Tom

#599191

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Tom

Conditional shortcodes can be nested, and so regular expressions are used to identify and extract nested conditions, but the more complex your conditional content the more likely it is your site may choke on these regexes.

You say the page does not load. Can you check your logs for errors?

If you haven't already, turn on the debug log by editing your wp-config.php file and change the line with WP_DEBUG like so:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

That will create a debug.log file in your wp-content directory which you can examine in any text editor. Try visiting the same page that includes these conditional shortcodes and then inspect the log.

In your question the key "once there is a ... in the content" is blank, it must have been stripped. Try rewriting that inside code tags so I can see what you were referring to.

Let me know about that and the logs.

I may need to get access to your site to see your set up and possibly take a duplicate for testing, but I'll wait to hear back from you.