Possible Duplicate:
Using short codes

I want to add a slideshow in the header section of twenty eleven theme instead of header image. I have tried different plugin , but the only work into the post or int the widgets. they use the shortcode like [sample_slide id="1"] . But , if I could use them into the header.php i might be satisfied. But it doesn't work into the php code. What can I do ?


You can use the do_shortcode() function to execute shortcodes within PHP.

<?php echo do_shortcode( '[sample_slide id="1"]' ) ?>

Although I'm sure a lot of the slider plugins out there have template tags which you can use to insert the slider into your header.php file.

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