Hello everyone,
I've recently begun experimenting with the Short Codes in WordPress.
I'm an experienced PHP programmer but I'm having trouble getting WordPress to parse my codes.
I am using the "Mystique" theme.
I have modified the theme/mystique/functions.php to include:
require_once('lib/settings.php');
require_once('lib/shortcodes.php');
require_once('lib/brandons_shortcodes.php');
(Brandons_Shortcodes obviously being my test files)
I have then made a brandons_shortcodes.php file inside the lib directory with this:
<?php
//Define the function (what you want the shortcode to do)
function hello(){
return 'Hello World! I am a test shortcode! WOOT!';
}
//Add shortcode. The first value (hw) is how to call the short code, the 2nd value is the function it should execute.
function add_shortcode('hw', 'hello');
?>
Now whenever I make a new post with [hw] it doesn't do anything. It just prints "[hw]"
What am I doing wrong?