ID of parent Menu

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.

Adding an additional menu in WordPress

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

Custom menus not showing

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!

Setting up menus before making a template live

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.

Add qtranslate language select box to menu [closed]

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(); ?>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)