is there any way to display widget in menu. Actually what i want is "site stat" in the menu. (black area) At the right. link

1 Answer 1


you can register a new sidebar, add it to the menu area and then add a widget to it: you can register a sidebar by adding this function to your functions.php:

register_sidebar( array(
        'name' => __( 'Site Stat Widget'),
        'id' => 'stat-widget',
        'description' => __( 'The Site Stat Widget'),
        'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
        'after_widget' => '</li>',
        'before_title' => '<h3 class="widget-title">',
        'after_title' => '</h3>',
    ) );

And add the function below to the menu area (i believe within the #openclosecontent div probably in header.php) :

<?php dynamic_sidebar( 'stat-widget' ); ?>

If you do it right you'll see a new sidebar in your widget page in the admin area where you can add the widget you want.

  • Eyal thanks for your help, it worked. but i still need some more tip. as you see from my site the widget is in the menu but how am i going to make it right, not under the menu text, in the same order and different color. when i try to change color,margin and size it automatically changes punch of staf with it
    – 1907
    Commented Jun 16, 2012 at 7:45
  • 1907, this is not a support forum. Now you are asking for a CSS issue that should be placed at StackOverflow. Also, when a question is correctly answered you should mark it as such. Please, read the FAQ.
    – brasofilo
    Commented Jun 16, 2012 at 9:45
  • since it an easy one just give float:right to #sofa_stats-3. but it will still show above the menu and not in the same line. you can try to move the widget within the #globalnavi to make it in the same line but i am not sure about this one.
    – Eyal
    Commented Jun 16, 2012 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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