Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

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.

share|improve this answer
    
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 Jun 16 '12 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 Jun 16 '12 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 Jun 16 '12 at 13:19
add comment

Your Answer

 
discard

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.