Displaying WordPress short codes

I’m in the process of writing some instructions for a new plugin – one which uses WordPress short codes. They’re the useful codes that you put in square brackets and are replaced by something else.

The problem is then documenting, because your plugin then wants to convert your text to the appropriate output.

Thankfully, my solution is quick and simple – and it involves another short code!

Open up your themes function.php file and add the following lines of code to it…

add_shortcode('showme',show_me');
function show_me($paras="",$content="") {return $content;}

Then, simply wrap [showme] and [/showme] around any short codes that you don’t want to be interpreted but do want to be displayed.

Talk to me!

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from David Artiss

Subscribe now to keep reading and get access to the full archive.

Continue reading