Pick out specific menu item from code
its a simple one liner if you want to use jQuery: jQuery(‘#page-id’).attr(“href”, “http://www.google.com/”);
its a simple one liner if you want to use jQuery: jQuery(‘#page-id’).attr(“href”, “http://www.google.com/”);
I found the answer, so I’m posting it to help others out: In this file (depending on your server setup): /etc/php5/apache2/conf.d Change suhosin.ini on the following lines (remove the semicolons if applicable): suhosin.post.max_vars = 5000 suhosin.request.max_vars = 5000 The default 1000 will not work – 5000 seems to work well for my needs (so far!)
Rob, take a look at using register_nav_menu function in WordPress it allows you to build custom menus with ease. http://codex.wordpress.org/Template_Tags/register_nav_menu
Dropdown menu is something that handles by CSS or javascript (in some case) So a your theme should take care of that not the wordpress engine. When you add a nested menu items on wordpress menu that means wordpress will output a specific html structure for that menu. <ul> <li></li> <li></li> <li> <ul class=”sub-menu”> <li></li> … Read more
Add custom ID to wp_nav_menu list items
I finally solved it.I had to add menus under the appearance menu and worked perfectly.
Ended up using the following <script> $(function(){ var i =0; $(‘ul.sub-menu’).addClass (function(idx) { return “item-” + idx; }); }); </script> It adds a class of item-0, item-1, etc to each sub-menu it finds.
See the answer here: Dropdown Like Twenty-Eleven Theme Question Be sure to use the updated code toward the bottom of my answer. It should be self explanatory, but if you have any issues let me know and I’ll help you out. Be sure to back up your files before changing them in case you break … Read more
b-grader First, you should you this format to add menu location (in your function.php) add_action(‘init’, ‘register_top_menu’); function register_top_menu() { register_nav_menu(‘top_menu’, __(‘Top Menu’, ‘your_text_domain’)); register_nav_menu(‘bottom_menu’, __(‘Bottom Menu’, ‘your_text_domain’)); } (note: ‘your_text_domain’ is used for translation..) Then in the place you want the menu to apear.. <?php wp_nav_menu( array( ‘theme_location’ => ‘primary-menu’ ) ); ?> so… if … Read more
it turns out that after copying some code from another post (http://stackoverflow.com/questions/9439877/adding-menu-items-in-wordpress) for a filter in functions.php to add the search bar in the nav menu, when it wasn’t matching the menu, it was returning nothing (i.e erasing the $items) I stupidly copied this code in without testing… and it was the problem all along!