WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

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

How can I add the widget manually in the code ?

share|improve this question

Have a look at the the_widget() function. The first argument is required. It is the PHP class name of the widget. For example:

<div class="sidebar">
  <?php the_widget('WP_Widget_Search') ?>

You can also pass on extra arguments:

<div class="sidebar">
  <?php the_widget('WP_Widget_Text', 'title=Hello&text=World') ?>
share|improve this answer

Depending on how your call to dynamic_sidebar() is setup, you should be able to drop them in before or after the function. For example:

<div id="sidebar">
    <ul class="sidebar">
        <!-- Your Widget Here -->
        <?php dynamic_sidebar(); ?>

You can put your widget (as an <li> in this case) right in there and voilà!

share|improve this answer
can I call any widget manually? e.g <?php word_tube_widget(); ?> – Waseem Abu Senjer Jan 17 '12 at 12:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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