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.
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:
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.