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?
adding the custom menu also seemed to nullify the fixed positioning at the top of the page…
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.
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.
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.
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.
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);
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.
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.
- The topic ‘top bar menu’ is closed to new replies.