wordpress superfish dropdown menu
I finally solved it.I had to add menus under the appearance menu and worked perfectly.
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!
All you need to do is enable custom menu’s by creating a functions.php in your current theme, and or if it already has a functions.php file, you just need to add this: add_theme_support( ‘menus’ ); And you will be able to add menus before making them live.
It looks like this behavior is the result of adding custom post types to the query. See http://wordpress.org/support/topic/wp-nav-menu-dissapears-in-category-pages-1
In my header.php I added the following <div style=”float: right; margin: 7px 15px 0 0;”> <?=qtrans_generateLanguageSelectCode(‘dropdown’);?> </div> <?=..?> is the same as <?php echo … ?> or <?php function(); ?>, but I prefer the shortcode just next to: <?php ct_primary_nav_menu(); ?>
Sorted! Just Added style=”float:right;” with <li>
You can do that with CSS text-indent: text-indent:-9000px;. That way your text is still there for accessibility.