dimanche 30 novembre 2014

Display function from functions.php in tag.php


I've added several functions to the functions.php file. I call those functions using a shortcode [shortCode] while in posts, pages, and widgets. But the [shortcode] will not work outside of posts, pages, or widgets. I've tried it in article titles and in other files, but it doesn't work.


I'd like to add a [shortcode] to a function to my tag.php file, but I can't figure it out. Can someone help me?


EXAMPLE FUNCTION



function dynamicContent(){
return 'some dynamic content';
}
add_shortcode('Dcontent', 'dynamicContent');


How can I get the [Dcontent] shortcode to work in the tag.php file?


Thanks, Todd





Aucun commentaire:

Enregistrer un commentaire