Hi I am setting up a demo and I’m trying to display my short codes in pre tags but wordpress keeps executing the shortcode.
How do I stop this?
Thanks in advance
,
Zef
- Author had a File in an Envato Bundle
- Author was Featured
- Bought between 50 and 99 items
- Exclusive Author
- Has been a member for 4-5 years
- Item was Featured
- Referred between 500 and 999 users
- Sold between 250 000 and 1 000 000 dollars
Here’s a trick on that… Type them like this:
[<span>Some Shortcode</span>]
...The spans get hidden ‘cause it’s html, obviously, and WordPress doesn’t see it as an executable shortcode.
Ah nice one thanks! 
ThemeBlvd said
Here’s a trick on that… Type them like this:[<span>Some Shortcode</span>]...The spans get hidden ‘cause it’s html, obviously, and WordPress doesn’t see it as an executable shortcode.
I don’t see the solution of this trick!
“span” tag remains visible in pre tag! How to make disable execution shortcode in the pre tag and not to display any other trash?
Never mind…
There is one solution is to convert first left bracket [ into [.
- Author had a File in an Envato Bundle
- Author was Featured
- Bought between 50 and 99 items
- Exclusive Author
- Has been a member for 4-5 years
- Item was Featured
- Referred between 500 and 999 users
- Sold between 250 000 and 1 000 000 dollars
Ilyon said
ThemeBlvd said
Here’s a trick on that… Type them like this:[<span>Some Shortcode</span>]...The spans get hidden ‘cause it’s html, obviously, and WordPress doesn’t see it as an executable shortcode.I don’t see the solution of this trick!
“span” tag remains visible in pre tag! How to make disable execution shortcode in the pre tag and not to display any other trash?
First off, he never said anything about using a pre tag. And second you are incorrect; “span” tags do not remain visable in a “pre” tag. Pre tags retains white space, but it still execute HTML . Having your website convert code put into pre tags to be shown on a webpage is something you have to program your site to do (like ThemeForest forums for example).
http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_preSo, hopefully now you see the solution of this trick 
Ilyon said
ThemeBlvd said
Here’s a trick on that… Type them like this:[<span>Some Shortcode</span>]...The spans get hidden ‘cause it’s html, obviously, and WordPress doesn’t see it as an executable shortcode.I don’t see the solution of this trick!
“span” tag remains visible in pre tag! How to make disable execution shortcode in the pre tag and not to display any other trash?
It will remain visible if you put it in the “Visual” tab of the page editor in WordPress. WordPress will automatically convert
<span />to
<span>
- Author had a File in an Envato Bundle
- Author was Featured
- Bought between 50 and 99 items
- Exclusive Author
- Has been a member for 4-5 years
- Item was Featured
- Referred between 500 and 999 users
- Sold between 250 000 and 1 000 000 dollars
Pressateers said
Ilyon saidIt will remain visible if you put it in the “Visual” tab of the page editor in WordPress. WordPress will automatically convert
ThemeBlvd said
Here’s a trick on that… Type them like this:[<span>Some Shortcode</span>]...The spans get hidden ‘cause it’s html, obviously, and WordPress doesn’t see it as an executable shortcode.I don’t see the solution of this trick!
“span” tag remains visible in pre tag! How to make disable execution shortcode in the pre tag and not to display any other trash?<span />to<span>
Aw yes, very true. I would just assume if someone was using HTML , they’d be working in the HTML tab, especially someone who’s putting together a demo to show off shortcodes for a theme they’ve developed.
It might be worth creating s shortcode that wraps content in a pre tag but doesn’t pass it through do_short code:
is the shortcode: [button]button/button
When you define your short code, just return $content instead of do_shortcode($content)
