Adding custom text in items titles from wp_nav_menu()

The following works, but with the following caveats. It will run for every menu, but it will not run for wp_page_menu, a usuall default callback if a menu can’t be found. Finally, menu items aren’t necessary pages – so you may want to do some logic to check that the menu item you are dealing … Read more

Add “parent” class to parent menu items

This may not be the ideal solution, depending on what you need the class for, but you could add a “parent” class via JavaScript. The line below uses the jQuery :has() selector: $(‘#nav-id’).find(‘li:has(ul)’).addClass(‘parent’);

Search box as a menu item in the nav menu output by wp_nav_menu?

based on : http://wpfirstaid.com/2010/10/extend-the-wordpress-menu/ function wpa_58902($items){ $search=”<li class=”search”>”; $search .= ‘<form method=”get” id=”searchform” action=”https://wordpress.stackexchange.com/”>’; $search .= ‘<label for=”s” class=”assistive-text”>Search</label>’; $search .= ‘<input type=”text” class=”field” name=”s” id=”s” placeholder=”Search” />’; $search .= ‘<input type=”submit” class=”submit” name=”submit” id=”searchsubmit” value=”Search” />’; $search .= ‘</form>’; $search .= ‘</li>’; return $items . $search; } add_filter(‘wp_nav_menu_items’,’wpa_58902′);

How do I make a wordpress plugin with menu item etc

If you want a frontend page you’ll have to create one with your plugin’s shortcode as the content. Then you display your plugin’s output in-place of that shortcode: /* Plugin Name: WPSE67438 Page plugin */ class wpse67438_plugin { const PAGE_TITLE = ‘WPSE67438’; //set the page title here. const SHORTCODE = ‘WPSE67438’; //set custom shortcode here. … Read more

WordPress Add javascript:void(0); to menu link item?

I am not sure how it does effect the SEO but just to answer this question:- You can not save menu item with javascript:void(0); because WordPress filter the URL using function esc_url() thus removing bad values. And it all happens in Nav Walker class. So you need to alter the URL when WordPress done with … Read more

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