I'm trying to use shortcode in my page, I'm starting with a simple test.
In functions.php
:
function HelloWorldShortcode() {
return '<p>Hello World!</p>';
}
add_shortcode('helloworld', 'HelloWorldShortcode');
In index.php
:
[helloworld]
This doesn't produce <p>Hello World!</p>
. Instead I just get the text [helloworld]
.
How can I get shortcodes to work in a PHP document?