I just noticed when I was trying to print on the page how to execute a certain shortcode, that the shortcode is executed even within the < code > tags.
I am trying to get it to where I can display EVERYTHING inside the code tags and not have wordpress do anything to it, ie:
<code>[shortcode]</code>
Exactly as you see the above line here on stackoverflow, I want it to display on my wordpress blog, even if [shortcode]
is a shortcode (do not execute shortcodes).
I tried using strip_shortcodes()
http://codex.wordpress.org/Function_Reference/strip_shortcodes
However, this actually takes the entire text out of the content, not just prevents it from being executed.
Any idea how to do this?
I just found the answer and I thought instead of deleting my question I would answer it myself. I have been working with WordPress for years and have never heard of this issue.
To get wordpress to display shortcodes and not execute them, you must use double brackets, ie:
WordPress will display it in single brackets, unexecuted.
If you’re having shortcodes with content try this