I noticed there are plugins to allow shortcode usage in widgets, and they obviously work on posts/pages, but they don't seem to work when added directly to the theme files.

Is there a way to allow shortcodes to work when added to a theme file?


Try do_shortcode()

<?php echo do_shortcode('[your_shortcode]');?>

if you are trying to use shortcodes in PHP templates then you need to use this function :


check this out :


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.