The tag has no wiki summary.

learn more… | top users | synonyms

53
votes
11answers
24k views

Display a portion/ branch of the menu tree using wp_nav_menu()

I have a menu defined in WP Admin that looks like this: I want to be able to display all the child links on the sidebar whenever I am at a parent page. For example, if the user is on my "About Us" ...
11
votes
3answers
565 views

Wordpress API Menu/Submenu Order

I'm developing a child-theme using Wordpress 3.4.2 and the development version of the Options Framework by David Price. This is my first theme and I'm relatively new to this, so I've had a look into ...
7
votes
1answer
2k views

How to add sub-menu to a menu generated by wp_nav_menu by using plugin

I have a menu generated by wp_nav_menu which look like <ul class="nav-menu" id="menu-top-nav"> <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-43" ...
6
votes
2answers
839 views

Getting custom admin submenu item to highlight when its active

I have a custom post type, Jobs, with 3 taxonomies under it in the Admin menu. One of the taxonomies is Status, which is either Active or Closed. I want a menu item under Jobs for Active Jobs. I ...
5
votes
5answers
1k views

Add separator to admin submenu

I would like to add a separator to the admin submenu section, NOT in the top level section. I'm thinking of using javascript and styling to do the job, but I was wondering if there's a more ...
5
votes
1answer
7k views

Display only page specific sub menu items using Custom Walker

I've just implemented the technique described at http://wordpress.org/support/topic/wp_nav_menu-list-only-2nd-level-separate-submenu/page/2 when implementing a theme for a client. When I run the theme ...
4
votes
3answers
4k views

Add a .last class to the last <li> in each ul.sub-menu

I've seen a lot of code on how to add a first and last class to a WordPress menu, but in my instance I would like to add a last class to the last li in the sub-menu that WP generates. Here's what I ...
4
votes
5answers
4k views

how to create a menu with all sub categories?

Is it possible to create a menu with a category such that each time that I had a sub category that automatically display on the menu? As far as I know, if I have a menu with the category "fruit", and ...
4
votes
1answer
1k views

Remove a menu item created by a plugin

I'm trying to remove a menu item and tried several approaches, but have not had any luck. It was created from a FAQ plugin. If I use this line: remove_menu_page( 'edit.php?post_type=question' ); ...
4
votes
1answer
364 views

Show only 2nd level of navigation depending on active navigation

For example, suppose a menu like so: Parent 1 Child A Child B Parent 1 Child C Child D Child E Parent 2 Child F In a certain part of my template, I want something to show depending on ...
3
votes
1answer
376 views

How Do I Programmatically Better Organize Custom Post Type Menus?

A project I inherited had a dozen custom post types. Trouble is, they all come off the admin menu sidebar separately. It's not very tidy. Is there a plugin where I can make these subitems of a parent ...
3
votes
2answers
298 views

Exclude one item from wp_list_pages( $args );

I have a menu that is currently shown with wp_list_pages( 'title_li=' ); This shows all the sub pages from all the pages in the menu. I want to exclude a page with id 56 from displaying its sub ...
3
votes
1answer
170 views

How Can I remove or hide the export page in WordPress menu?

I'm trying to remove the export.php page from WordPress admin menu -> tools for a multisite so only the network admin could see it I have the following code so far but can't get it to work. ...
3
votes
2answers
450 views

checkbox in post add/edit to add/remove the post from menu

Introduction: I have created several post type for my theme. To display a post from a post-type I need to go in appearance/menu and then add the post manually. My Goal: I want to add two radio ...
2
votes
1answer
2k views

Sub-Pages only of menu items in current branch using a custom menu

Although I did a thorough research I could not find a solution. Only solutions coming close. My custom menu ("top") shows this structure (you see a part of it): page 1 subpage 1.1 category A ...
2
votes
3answers
945 views

How to restrict plugin's sub-menu pages to admin/subscribers?

I am working on a plugin with 6 submenu pages. I want 5 of them to be accessible by Administrators only and 1 of them to be accessible by Subscribers only. Both user roles will have different ...
2
votes
1answer
469 views

Custom Nav Walker to show siblings and children of current branch?

I have seen very similar (if not exact) queries to this all over Google, but always seem to find something short of what I need. I am trying to create my full vertical menu using wp_nav_menu in my ...
2
votes
1answer
451 views

Primary and secondary menus

I am trying to make each individual tab on my primary menu link to the secondary menu so that in effect each individual primary tab leads to an individual set of tabs in the secondary menu rather than ...
2
votes
1answer
110 views

Put a wp_nav_menu inside another one

I've got two wp_nav_menu's defined - main and sub. The backend menu editor lets me add pages or categories or custom links to my menu, and I can place them under existing pages/categories/links. ...
2
votes
2answers
1k views

Automatically add a page to menu

I write a lot of content on a daily basis, and I have a lot of menus, submenus etc. I don't want to use the menu gui each time I create a new page/article. Is there any plugin or way of automatically ...
2
votes
0answers
335 views

Custom menu walker: how can i check first item

I need to output different html code only for the first item of my submenus. How can I check in start_el() function if current item is first or not? Example: Menu voice 1 -- Sub 1 -- Sub 2 -- Sub 3 ...
2
votes
1answer
237 views

Two Navigation Menus - secondary nav is including main nav

Two Navigation Menus in Themes Produce the same menus? reference the subject on page link above. i created two navs, yet the secondary nav includes all pages. the main nav is fine, but the secondary ...
2
votes
1answer
5k views

How show sub menu only using wp_nav_menu()

I am using this code to show the custom menu subpages if you are on the parent page. But what this code also shows is a parent page on a page that has no sub menu, which I would like hidden. Basically ...
2
votes
1answer
665 views

Using custom post types in submenu + custom title

I'm planning to use a couple of custom post types for a plugin of mine. The whole plugin should reside under 1 toplevel menu item. Thus I would prefer a menu structure like so: Dashboard Posts [...] ...
1
vote
1answer
2k views

Is It Possible To Add Custom Post Type Menu As Another Custom Post Type Sub Menu

I currently developing a wordpress plugin that is using two custom post types. What I want to know here: is it possible to add a custom post type menu as another custom post type's sub menu?
1
vote
1answer
150 views

Menus like a CMS

Here is an example structure of some content: Parent A -- Child A -- Child B Parent B -- Child C -- Child D Parent A should link to the content of Child A and Parent B should link to the content of ...
1
vote
1answer
166 views

Walker nav remove submenu ul from a certain depth

I want to remove sub-menu ul and .menu-item-has-children class when the menu depth is superior or egal to 2. So, I only want a menu with 3 sub-menu at maximum. Other item children will still ...
1
vote
1answer
476 views

next_post_link() on custom menu structure

In a blog, I am using next_post_link() and prev_post_link() extensively on posts. I also have a number of pages that I show in a WP3 menu. They are organized in topics and sub-topics e.g. like so: ...
1
vote
1answer
1k views

Order Admin sub-menu items?

I am adding items to a CPT Admin menu using add_submenu_page which works great, but they are added to the bottom of the sub-menu after the CPT options. I want to be able to have them on top , but I ...
1
vote
2answers
50 views

Check if menu id = $specific_id - then insert specific <img>

I currently have a menu structure as followed: <ul class="level-1" id="menu-menu1"> <li id="menu-item-411"> <a href="http://www.link.com">Frontpage</a> </li> ...
1
vote
1answer
25 views

Is it possible to pass variables from add_user_page?

If have hooked into admin-menu like this: function adminmenu_users_reserves(){ add_users_page('Reserver', 'Reserver', 'read', 'reserve_list', 'show_userlist'); } add_action( 'admin_menu', ...
1
vote
1answer
50 views

Find the Children of a Page then Echo it as a Bulleted List of Links (menu)

I am trying to check if a parent Page has children. If it has children I would like to echo the children as a bulleted list with links to each child (basically a menu). Right now I have the following ...
1
vote
1answer
298 views

Add items to a menu dynamically

I'm doing a site in WP with dynamic and static content. I'd create the menu from the admin panel. I have 5 sections (Home, about, Boats, News(blog), contact). I'd create a custom post type with new ...
1
vote
2answers
80 views

Does loading of sub pages in menu cause load to the server?

I am working on a wp site where I need to manage 500s of child pages for a single page such as About menu can have more child pages need to manage those child pages as sub menu and I have more than 5 ...
1
vote
1answer
366 views

Customizing the a tag with Semantic UI

I'd like to use Semantic UI to aid development of a Wordpress template for a project. For a submenu I intend to use one of the Secondary sub menus found just at the bottom of the Pointing section. ...
1
vote
1answer
539 views

Get page by template?

I'm in a complicated situation. I'll try to explain it as easy as possible. Imagine the following pages: Page 1 Page 2 Subpage 1 Subpage 2 Subpage 3 Each subpage of page 2 lists posts from a ...
1
vote
1answer
84 views

Creating a nav menu

I am not very familiar with WordPress so my knowledge with this is limited. I am working on a travel website where I need to show navigation menu and I am not sure how I can achieve the desired ...
1
vote
3answers
961 views

Subnav menu - adapt to show the same on parent, child & grandchildren pages?

I found this very useful code at the wp codex, it basically lists out the parent, child and grandchild pages, I'm using it in my sidebar and it works well for the parent and children pages, but when ...
1
vote
2answers
952 views

Using default WP menu functionality to link to custom post-type listing?

I'm completely starting over with a wordpress project that began a couple of weeks ago, and basically i'm totally discovering wordpress, so please bare with me. I might be completely misunderstanding ...
1
vote
1answer
475 views

add_submenu_page function to show videos table

wondering if its possible to show the attachments admin list for videos by using a custom menu link? Any pointers welcome! D. add_action('admin_menu', 'mt_add_pages'); function mt_add_pages() { ...
1
vote
1answer
189 views

Admin - Load existing admin template as a submenu page

I'm trying to save my client a few clicks. I've created a custom role of "Customer" and I'd like to get them to that screen, without having to have them click "Users" and then select the "Customer" ...
1
vote
1answer
528 views

How can I make this custom menu work?

Can someone share with me the easiest way to convert this to work with wordpress’s 3.0 built in menu support. So far I have the topnav menu working correctly, but I’m having a hard time getting the ...
1
vote
1answer
811 views

Add custom menu item using wp_nav_menu_items filter

I have added a snippet to add a "Profile" link to my website navigation menu. My code: add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link'); function my_nav_menu_profile_link($menu) { ...
1
vote
0answers
76 views

Removing “Sub-menus” from My Sites Drop-down in Admin Bar

How does one remove the "sub-menu" that appears to the right of each site listed in the My Sites drop down from the admin bar? That is, I want to have a list of My Sites without the Dashboard/New ...
1
vote
0answers
110 views

Using parent slug variable to display proper submenu not working properly

There are three submenus I have which display based on where you are in the site using the "the_parent_slug()" function. (personal-liability, life-and-health, and business) So when I use the search ...
1
vote
0answers
226 views

Admin Menu - Highlight top-level menu when on a sub-menu page (without showing sub-menu)

This is the current situation: I am writing a plugin that has a top-level menu page The plugin also contains other sub-menu pages The sub-menu pages are not assigned a parent slug (thus they do not ...
1
vote
2answers
90 views

How to customize submenus isn wordpress theme [closed]

I have a wordpress theme and in the header.php file it is displaying menus through this line : wp_nav_menu( 'theme_location=menu_2&menu_id=nav&container=&fallback_cb=menu_2_default'); ...
1
vote
0answers
62 views

What action/filter/function determines “current” class in WP Admin Menu

I have created a submenu page for the Media List Table. The link actually points to a custom view I have created called Resources. I am looking for the correct location where the Admin menu determines ...
1
vote
1answer
2k views

Creating WordPress Plugin solely for Admin panel with dash menu and submenus

I am attempting to create a WordPress plugin which allows the client to use for help and other resources in a friendly interface. It would be desired if I could have guidance on creating a WordPress ...
1
vote
2answers
209 views

Wordpress remove Submenus

I found an answered question here Remove menus and submenus 2 Answers for my problem but is there a way of changing the code a bit so that it removed the submenus for all Editor roles. not only for ...