100 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
ZefWebDesign says

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

1028 posts
  • Has referred 500+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
ThemeBlvd says

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.

100 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
ZefWebDesign says

Ah nice one thanks! :P

153 posts
  • Has been part of the Envato Community for over 3 years
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 1+ items on Envato Market
+2 more
Ilyon says
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?

741 posts
  • Had an item featured on Envato Market
  • Won a Most Wanted contest
  • Has been part of the Envato Community for over 5 years
  • Has sold $40,000+ on Envato Market
+4 more
Orbital_Themes says

Never mind…

153 posts
  • Has been part of the Envato Community for over 3 years
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 1+ items on Envato Market
+2 more
Ilyon says

There is one solution is to convert first left bracket [ into &#91;.

1028 posts
  • Has referred 500+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
ThemeBlvd says
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_pre

So, hopefully now you see the solution of this trick :-)

229 posts
  • Has been part of the Envato Community for over 3 years
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in United States
Pressateers says
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
&lt;span&gt;

1028 posts
  • Has referred 500+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
ThemeBlvd says
Pressateers said
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
&lt;span&gt;

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.

1148 posts
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
fillerspace says

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)

by
by
by
by
by
by