WordPress.org

Ready to get started?Download WordPress

Forums

WP-TopBar
[resolved] top bar menu (12 posts)

  1. melputnam
    Member
    Posted 1 year ago #

    I'm using TopBar version 5.0. Followed your instructions for adding a custom menu to the TopBar but am having trouble. The menu being displayed is my main custom menu. Won't recognize the new menu I created for TopBar. Also how do you run the menu horizontal instead of vertical?

    http://wordpress.org/extend/plugins/wp-topbar/

  2. melputnam
    Member
    Posted 1 year ago #

    forgot to give you my url: http://claytreese.com/WP/

  3. melputnam
    Member
    Posted 1 year ago #

    adding the custom menu also seemed to nullify the fixed positioning at the top of the page...

  4. Bob
    Member
    Plugin Author

    Posted 1 year ago #

    I believe that you need to create a custom walker (see http://codex.wordpress.org/Function_Reference/wp_nav_menu) in order to change the menu to horizontal.

    I've made a fancier, horizontal menu by copying the walker code from my Theme into the wp_nav_menu function.

    It is not my expertise...though.

    Bob

  5. melputnam
    Member
    Posted 1 year ago #

    Thanks for your reply. I'll check into that. The bigger issue is that the correct menu is not being recognized. The plug in is displaying the main menu, not the new custom top bar menu I created.

    Any suggestions?

  6. Bob
    Member
    Plugin Author

    Posted 1 year ago #

    Can you confirm that you selected the menu you created with the drop down box under theme locations on Menu | Appearance ?

    That tells WordPress to use your custom menu on the new location that you created in your functions.php file.

    Bob

  7. melputnam
    Member
    Posted 1 year ago #

    yes sir

  8. Bob
    Member
    Plugin Author

    Posted 1 year ago #

    I am on a plane heading home. Can you email me screen shots of the custom php page and the appearance | menu tab? My email address is found in the wp-topbar.php file.

  9. Bob
    Member
    Plugin Author

    Posted 1 year ago #

    Got them. I need to change the FAQ to give better instructions. I'll update in v. 5.01

    The issue is that the 'menu' name below must MATCH what the Menu name you created on the Appearance | Menu tab.

    So, if you new menu is named "Translation" - here is the code you need:

    $defaults = array(
    'menu' => 'Translation',
    'menu_class' => 'wptb-menu-class',
    'container_class' => 'wptb-container-class',
    'echo' => 0
    );
    $menu = wp_nav_menu( $defaults);
    echo preg_replace("/\r\n|\r|\n/",'',$menu);

  10. melputnam
    Member
    Posted 1 year ago #

    That worked. Thanks so much for the fix and the excellent plug-in.

    Now I just need to work out the vertical menu...oh boy.

  11. Bob
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks - .. if you like the plugin, pls give a positive review!

    .....

    Here is the replacement FAQ that will go into version 5.01:

    Create a new menu via the standard WordPress Appearance | Menu. Name it something unique, say "Translation", to create the menu use the PHP Option ("Before" or "After" - your choice)... using this code:

    $defaults = array(
       'menu' => 'Translation',
       'menu_class' => 'wptb-menu-class',
       'container_class' => 'wptb-container-class',
       'echo' => 0
    );
    $menu = wp_nav_menu( $defaults);
    echo preg_replace("/\r\n|\r|\n/",'',$menu);

    Then style using .wptb-menu-class or .wptb-container-class (whichever you prefer.)

    To make the Menu fancy, you might need to create a custom walker (see http://codex.wordpress.org/Function_Reference/wp_nav_menu) on all the gory details on this WordPress function.

  12. Bob
    Member
    Plugin Author

    Posted 1 year ago #

    I just pushed 5.01 with the FAQ changes and a few defect fixes.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic