WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ?

share|improve this question

marked as duplicate by toscho Dec 21 '12 at 9:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Possible Duplicate: wordpress.stackexchange.com/q/73132/19726 – shea Dec 21 '12 at 9:27

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.

share|improve this answer

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