What is a WordPress Shortcode?

Open a pair of PHP tags and write code to output the results of the “do_shortcode()” function. Pass the shortcode into “do_shortcode()” as a parameter, typing it out as a string. This is how it should look:

<?php echo do_shortcode(‘[shortcode]’); ?>

Use single quotes around the shortcode so you can type out a shortcode with an attribute containing double quotes, like this:

<?php echo do_shortcode(‘[shortcode attribute=”setting”]’); ?>

Posted in Wordpress