I am developing my own theme,Every thing is working fine,but short codes are not working.
I deactivated my theme and i checked with the twenty twelve theme,here the short codes are working.
i wrote the following code in index.php
echo do_shortcode('[layerslider id="1"]');
it is not working,even in pages too([layerslider id="1"]
)
but the following custom shortcode is working
i wrote this code in function.php
function codes()
{
echo "short code working";
}
add_shortcode('codes','codes');
echo do_shortcode('[codes]');
You need to use return not echo in the function. I changed the shortcode name so it is different to the function name in this example.
Try this:
functions.php
index.php
On the twenty twelve theme shortcodes you need to make sure you copy them into the new theme you are building.
Hope it helps.