The tag has no wiki summary.

learn more… | top users | synonyms

16
votes
3answers
7k views

Programmatically add a Navigation menu and menu items

Through API functions, I want to define a new Navigation menu, select it in the current theme, and then insert a few Pages as menu items. This is to be done for instance on a theme activation. ...
6
votes
3answers
11k views

wp_nav_menu(), how to change <li> class?

I'm building a menu for my website. The static is looking like this: <nav> <ul id="menu"> <li class="item_1"><a href="#">Item 1</a></li> <li ...
6
votes
1answer
1k views

Using Wordpress to make a “Product Search” type navigation drilldown

This is somewhat of a follow-up to a question I asked some time ago: Trying to design nice category drilldown with one "held" taxonomy and a repeatable list of categories I've sort of got ...
6
votes
2answers
64 views

Filter wp_nav_menu()

I try to split my navigation into 3 single navigation bars (level 1, level 2 and level3+). Three because they're separated over the site and they should only appear depending on the current page. ...
5
votes
1answer
1k views

Custom ID for certain menu item?

I'm displaying Wordpress menu using this function: wp_nav_menu( $args ); Menu is set in wp-admin/nav-menus.php. Can I somehow attach ID of my choice to one of the items? I want the menu to look ...
5
votes
2answers
304 views

Call custom field into menu item

I have a navigation menu in Wordpress. I would like it to check if the page has a custom field of "menu_icon" and if it does, add that custom field into the menu item it corresponds to. I'm sure this ...
5
votes
2answers
4k views

Wordpress Custom Post Types with a page as a parent?

I have a lot of custom type items in my new WP project, and for navigation reasons, I want to make the parent to some of them a Wordpress page. The problem is that apparently, Wordpress does not let ...
5
votes
3answers
1k views

Use navigation path from menu for permalink

I now switched to permalinks and defined my own structure /%postname%. If I click on a menu item it takes the path from the parent page (hierarchy defined directly when editing a page). What I want ...
4
votes
3answers
1k views

How to Get Next or Previous Post in a Specific Tag?

I'm trying to create links to the next and previous posts within a specific tag (on the post page itself), but I can't seem to find a plugin or source that does this. I want to be able to something ...
4
votes
1answer
803 views

Add custom meta to nav menu items

I need to attach meta data to every menu item, with a key 'foo'. Is it possible to do that, without editing core WP? A quick look at the nav-menu files showed that no hooks exist near the place I ...
4
votes
1answer
1k views

How to order adjacent posts (prev / next) by custom field value?

I am using the More Fields and More Types plugins to create a custom post type called product. This custom type is based on the Post type. One of the fields is named lot which is an integer ...
4
votes
3answers
798 views

How to modify the “after” of last element in wp_nav_menu

When using wp_nav_menu how do I make it so 'after' => does not show on the last element of the list?
4
votes
1answer
1k views

Getting the Next and Previous Posts Titles in the Sidebar?

Let's assume that I have the following posts with the following titles: PostA (is assigned to the 'category 1') PostX (category 2) PostB (category 1) PostC (category 1) PostD (category 1) PostY ...
4
votes
1answer
339 views

Navigate with keyboard in Gallery shortcode

I am using Wordpress Gallery shortcode and I was wondering if there is a way to navigate using the arrow keys? Like if I view an single image and used the right arrow to navigate to the next image in ...
3
votes
3answers
5k views

How to add CSS Class to previous_post_link or get previous/next post link URL

How can I add a CSS Class to the previous_post_link output or just get the URL and create the HTML markup myself
3
votes
5answers
3k views

WordPress admin bar overlapping twitter bootstrap navigation

I am having an issue with the WordPress admin bar overlapping the twitter bootstrap (2.3.0) nav bar. I have tried this fix: body.admin-bar .navbar-fixed-top { top: 28px; } .navbar .brand { ...
3
votes
2answers
5k views

Dynamically exclude menu items from wp_nav_menu

I tried looking for info about how to exclude/remove nav menu items from custom menus, and the only thread I found did not have any answers that were useful to me. 1. Background: I put together a ...
3
votes
1answer
3k views

show current navigation path from menu

I want something like this Home > Products > Steel > Nails This information should come from the menu structure! I installed Breadcrumb NavXT but it seems that it only takes the path I defined (this ...
3
votes
2answers
385 views

How to highlight the right item in the navbar

In my site i have a navbar which is created by using the new feature of wordpress 3 - "the menus ".In my site this navbar conatins both categories and pages. When I'm in a single post / sub-page , ...
3
votes
1answer
104 views

How to add a section to the menus configuration, offering hard coded items?

So, let me explain what I'm actually trying to do, maybe there's a better way to achieve it. I'm working on a theme, and I'd like the user to be able to easily position "special" items in the menu ...
3
votes
1answer
703 views

Wordpress Export Import Site Navigation Menu

When I do an export and import the menus get transferred but I have to set the Site Navigation Menu manualy. Obviously it's only a small detail but can I ask is this a bug or expected behaviour and is ...
3
votes
1answer
159 views

Assign title-specific class to list items in menu based on WP pages

I'm currently using a WP-generated list of pages for my site navigation - this is using the method wp_page_menu. I'd like to add custom styling to specfic list items in the menu, and I was wondering ...
3
votes
3answers
2k views

Nav menu separators?

Anyone know of a plugin that can, or have an idea how to, allow a user to drop in separators/dividers between certain nav menu items? Google only seems to bring up rookie CSS tips for first/last ...
3
votes
3answers
7k views

Using Image Links in Wordpress Navigation Menus Instead Of Text Links

Does wordpress support the capability to use images in the navigation menus instead of text links? I searched for this capability and found a site that shows how to include images in the menu through ...
3
votes
1answer
968 views

Determine if a navigation item has children

I am trying to determine if an item has a sub-item with depth 1 or higher. I cannot find anywhere if there is some function/query I can write that grabs the current item looks in the database if it ...
3
votes
1answer
3k views

Create a Widget Area in the Navigation Bar for the Genesis Theme Framework?

(Moderator's note: The original title was "How can I create a widget area in the navigation bar (Genesis specific)?"( I'm trying to create a widget area in my navigation bar. I'm attempting to adapt ...
3
votes
1answer
295 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
434 views

Highlight nav menu terms

OK so i have custom post types and custom taxonomies. I have a sub-menu that is made of the custom taxonomies. Example: registered taxonomy: Movies and terms: action, adventures, etc. (= menu ...
2
votes
2answers
3k views

WP_Query and next_posts_link

I cannot figure out how to make next_posts_link() work within my custom WP_Query. Here is the function: function artists() { echo '<div id="artists">'; $args = array( 'post_type' => ...
2
votes
3answers
5k views

Pagination with custom SQL query

I have my own SQL string to select Custom Post Type posts with specific WHERE clause. I've used the offset and limit to return appropriate posts depending on a page being displayed. That's working ...
2
votes
7answers
7k views

Display navigation menu item conditionally based on user capabilities

I have one "branch" of my main site's navigation tree that should only be accessible to a set of registered, logged-in users. I understand how to query a user's role and capabilities. This question is ...
2
votes
2answers
2k views

wp_nav_menu doesn't generate parent/ancestor classes

I don't know why the proper classes for menu item are not generated - all the elements in the tree which has subtree get only menu-item menu-item-type-post_type. The elements, which don't have ...
2
votes
2answers
951 views

Strict Standards Error bootstrap navwalker

I am having trouble understanding this error and I've not come across it before, please could someone help? Strict Standards: Declaration of wp_bootstrap_navwalker::start_lvl() should be compatible ...
2
votes
2answers
419 views

Exclude Private, Draft pages from Primary Nav when using custom menu

I'm looking for ways to prevent "private" and "draft" pages from appearing (to non-logged-in admins) in a site's Primary Navigation menu which is based on a custom menu - other than manually removing ...
2
votes
3answers
172 views

Can this navigation be done easily in WordPress?

Can anyone please let me know if a dual navigation style is easily achievable or not possible. A WordPress developer I'm in touch with is telling me it's not. Basically, we would like the navigation ...
2
votes
4answers
292 views

Making some links generated from the wp_nav-menu function unclickeable?

In this website: http://alexchen.info/brianfunshine/ I have a navigation menu taken from the twentyten theme. I want to make some links clickeable and some not (some don't have to behave like a ...
2
votes
2answers
4k views

What's the easiest way to duplicate an entire navigation menu?

What's the easiest way to duplicate an entire navigation menu? I don't care if it involves SQL commands or whatnot. I just have some really big menus that I'd like to duplicate. Didn't see a plugin to ...
2
votes
1answer
563 views

Test if page is child and has children, if so echo child pages also on grandchild pages

I am trying to show a sub-menu of child-pages only on level 2 pages (who have a parent) and if they have children. I am using the code below (made from several snippets I found), it works fine on ...
2
votes
1answer
302 views

Make compatible custom menu widget for Twitter Bootstrap

If I configure wp_nav_menu function, I can put the "items_wrap" option to achieve a nice navigation given by Twitter Bootstrap, thus: <ul class="nav nav-pills">%3$s</ul>. But, how to ...
2
votes
1answer
380 views

Why are navigation items saved in the database?

Maybe I am just not grasping the concept of WP right here but why is everything in Wordpress stored as a post of some type? I have a custom set of tables that house hundreds and thousands of items. I ...
2
votes
2answers
672 views

How can I implement faceted search with Wordpress 3.x?

I would like to allow visitors to a site to search for posts based on various attributes (categories, tags, custom fields). I have tried using Solr, but this doesn't appear to work. I tried using ...
2
votes
3answers
916 views

Hide and show menu subpages

I am sorry if this is not clear, but I am using translated wordpress so I am translating some names back. I have pages in menu and when I click on some item it goes to that page. But I need f. e. ...
2
votes
1answer
344 views

Previous & Next on Index Page broken

So the Next/Previuos on my index page is broken. It goes to page 2 but doesn't refresh the posts. It will work on my categories and it will work on my posts but it just won't work on the from page. ...
2
votes
2answers
4k views

wp_nav_menu: check if the list item has children and add a class to anchor link

I'm trying to add a class to anchor links of children element in wp_nav_menu both for pages and posts. Is there a way to modify the Nav Menu Walker and do so? Basically my custom walker looks like ...
2
votes
2answers
393 views

adding .current* tags to custom post types and taxonomies

TwentyTen adds some classes to custom menus, for instance: #access #menu-item-262.current-menu-item, #access #menu-item-262.current-menu-ancestor All the top-level links in my primary navigation ...
2
votes
1answer
1k views

BuddyPress - How to add logout in nav menu

How to add a logout option to the main nav menu (not to the top bar) in BuddyPress?
2
votes
1answer
605 views

Highlighting the current page in a navigation menu which links are generated with a custom loop?

This is a second navigation menu I'm using: <ul id="forums"> <?php $custom_posts = new WP_Query(); ?> <?php $custom_posts->query('post_type=bbp_forum'); ?> ...
2
votes
2answers
514 views

How to manually add an item to a submenu in a menu generated by wp_nav_menu?

Hey. I've been trying to figure this out for a long time but can't seem to crack it. I have created a menu using Wordpress 3 menu editor and it's all fine and working. But I want to manually add an ...
2
votes
1answer
338 views

current-menu-item not working with custom post type

I'm a wordpress newbie and I have annoying problem. I have a few custom post types (capability_type=post). Two of them i created with "Custom Post Types" plugin and when i put its categories in ...
2
votes
1answer
2k views

Get the children of the parent category

I'm trying to get all the children categories to display in this loop but I'm struggling with the code. This is what I have so far. <?php $args=array('orderby' => 'name', 'order' => 'ASC'); ...