100 posts
  • 5 Years of Membership
  • Affiliate Level 1
  • Collector Level 2
  • Exclusive Author
+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

1037 posts
  • Affiliate Level 6
  • Author Level 10
  • Collector Level 4
  • Top Monthly Author
+8 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
  • 5 Years of Membership
  • Affiliate Level 1
  • Collector Level 2
  • Exclusive Author
+1 more
ZefWebDesign
says

Ah nice one thanks! :P

153 posts
  • 4 Years of Membership
  • Affiliate Level 3
  • Author Level 5
  • Belarus
+3 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?

743 posts
  • Elite Author
  • Weekly Top Seller
  • Featured Item
  • Most Wanted Winner
+5 more
Orbital_Themes
says

Never mind…

153 posts
  • 4 Years of Membership
  • Affiliate Level 3
  • Author Level 5
  • Belarus
+3 more
Ilyon
says

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

1037 posts
  • Affiliate Level 6
  • Author Level 10
  • Collector Level 4
  • Top Monthly Author
+8 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
  • 4 Years of Membership
  • Collector Level 1
  • Exclusive Author
  • 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;

1037 posts
  • Affiliate Level 6
  • Author Level 10
  • Collector Level 4
  • Top Monthly Author
+8 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.

1149 posts
  • Affiliate Level 1
  • Author Level 3
  • Beta Tester
  • Collector Level 2
+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