using OOP approach to create plugin but stuck at making hyperlinks to work
using OOP approach to create plugin but stuck at making hyperlinks to work
using OOP approach to create plugin but stuck at making hyperlinks to work
Unlimited WordPress Menu
Weird behaviour on Edit Menus screen
If menu has submenu, add parent as first child
Menu by itself is a taxonomy in WP. It means that you can find all menus in wp_terms table, by running following query: SELECT * FROM wp_terms AS t LEFT JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id WHERE tt.taxonomy = ‘nav_menu’; Menu item is custom post type in WP. They are stored in wp_posts … Read more
You can remove it from the submenu array: function add_my_menu(){ global $submenu; add_menu_page( ‘Main Menu’, ‘Main Menu’, ‘manage_options’, ‘main-menu-settings’, ‘main_menu_settings’); add_submenu_page( ‘main-menu-settings’, ‘Sub Menu’, ‘sub menu’, ‘manage_options’, ‘sub-menu’, ‘sub_menu_settings’); unset( $submenu[‘main-menu-settings’][0] ); } The parent item is added by add_submenu_page in plugin.php as the first link if the parent doesn’t already have a submenu, resulting … Read more
I tried your code it works perfectly fine for me, to give output as: <div class=”container_class” id=”container_id”> <ul class=”menu_class” id=”menu_id”> <li class=”menu-item menu-item-type-taxonomy menu-item-object-category menu-item-154″><a href=”http://www.ohitsfunny.com/category/funny/”>Funny</a></li> <li class=”menu-item menu-item-type-taxonomy menu-item-object-category menu-item-159″><a href=”http://www.ohitsfunny.com/category/jokes-2/”>Jokes</a></li> <li class=”menu-item menu-item-type-taxonomy menu-item-object-category menu-item-156″><a href=”http://www.ohitsfunny.com/category/love/”>Love</a></li> <li class=”menu-item menu-item-type-taxonomy menu-item-object-category menu-item-155″><a href=”http://www.ohitsfunny.com/category/motivational/”>Motivational</a></li> <li class=”menu-item menu-item-type-taxonomy menu-item-object-category menu-item-157″><a href=”http://www.ohitsfunny.com/category/political/”>Political</a></li> <li class=”menu-item menu-item-type-taxonomy menu-item-object-category menu-item-158″><a … Read more
Use custom walker to add taxonomy terms to main nav menu
I don’t think you can use a menu for that, as menus are created manually in the Admin Panel. You will have to use wp_list_categories like this: $categories=get_categories(); $rand_keys = array_rand($categories, 5); foreach ($rand_keys as $key) { $cats .= $categories[$key]->term_id .’,’; wp_list_categories(‘include=”.$cats);
Appearance Menus Screen – menu item drop down menu not functioning