Have you ever wanted to display a shortcode in a post? i.e. like this: [gallery]
It’s actually quite simple thanks to a little-known feature of WordPress. All you need to do is double up on the brackets:
[[gallery]]
[[example]foobar[/example]]
Note where the double brackets are in that last example.
So just doubling up removes the shortcode ability. Nice.
Heh. Didn’t know that one. I used to enter HTML entities. Nice tip
Sorry again to bother you with this. After you told me I found your forum comments concerning this issue.. (sometimes it’s just hard to explain to google what you want, google really has to work on that..)
after a couple of tries, this is the code that worked for me
[_code lang="php"] <?php $string = file_get_contents('../../wp-content/themes/matala/YF-Box.php'); echo '[[php]' . htmlspecialchars($string) . '[/php]]'; ?> [/_code](without the
before
)
Thanks for the great plugin and that hint, of course.
Thanks for sharing this nice tip too.
Thanks for the great tip! I have also been doing this the hard way.
Awesome, didn’t know this either so I used spaces like [ gallery ] to avoid displaying it when writing about it
so to write what you wrote you used triple brackets? Like [[[gallery]]] to show [[gallery]]
Correct, I used triple brackets.
Hello Alex! Sorry don’t you know how to execute two shortcodes?
[shortcode1] [shortcode2] [/shortcode1]
Read http://codex.wordpress.org/Shortcode_API and look for references to
do_shortcode(). The documentation discusses how to do what you’re trying to do.great tip, thank you very much