The tag has no wiki summary.

learn more… | top users | synonyms

17
votes
3answers
10k 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. ...
8
votes
1answer
1k views

Mega Menu Walker

I'm trying to create a mega menu walker. Unfortunately, walkers completely escape my coding knowledge. I could really use some help getting it working. Here's the features I need: Wrap the ...
7
votes
1answer
2k 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 ...
7
votes
2answers
679 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. ...
6
votes
3answers
16k 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 ...
5
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 ...
5
votes
2answers
121 views

How to model a hierarchy for courses, levels and lessons?

I'm a bit of a wordpress noob and I'm diving head first into a course creation plugin. The structure will go program > course > level > lesson. Right now I have lessons set up as a custom post type ...
5
votes
2answers
418 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
2k 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
6answers
6k views

WordPress admin bar overlapping twitter bootstrap navigation [closed]

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 { ...
4
votes
1answer
1k 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
4k 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 ...
4
votes
2answers
6k 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 ...
4
votes
1answer
2k 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
937 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
161 views

How make get_next_post() return first post when viewing last one

I need a way to link to the first and the last post (CPT) created. For example, I'm in the last post and if I click in "next" I should go to the first. Now i have this <?php $next_post = ...
4
votes
3answers
2k views

Add Dividers or Separators Between Nav Menu Items

Does anybody have an idea on how to allow a user to drop in separators or dividers between certain nav menu items? Google only seems to bring up rookie CSS tips for first/last child selectors but I ...
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
465 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 ...
4
votes
1answer
410 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
2answers
4k 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' => ...
3
votes
3answers
7k 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
2answers
402 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
136 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
1k 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 ...
3
votes
1answer
2k 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
5k 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'); ...
3
votes
1answer
166 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
8k 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
2answers
124 views

Adding Post Counts to Menu (Nav) Programmatically?

I'm fairly stumped on this. Without getting too query-heavy, I was wondering what path one might take to produce a menu that links to a category of posts, and displays in parenthesis how many new ...
3
votes
1answer
2k 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
4k 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
449 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
3answers
6k 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
9k 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
3answers
2k 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
649 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
177 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
3answers
8k views

Show just one level of child pages, wp_list_pages woe

I'm working on a site that has a fairly large page structure a few levels deep - in some sections there are a lot of pages. The basic setup is something like this... Parent Parent Parent -Child ...
2
votes
4answers
296 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
3answers
2k views

wp_nav_menu always falls back to a menu

hey all, i'm writing an automated function that generates a menu from a function. it calls wp_nav_menu on each item from an array, because i want this to be dynamic. the problem is, no matter how i ...
2
votes
3answers
1k views

Add Javascript to Wordpress Menu

Is there a way to put javascript in the URL portion of a Wordpress menu item? I have a live chat function on my site, and I am supposed to put this code onto the site to make a link to open the live ...
2
votes
2answers
5k 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
2answers
1k views

Bar separated navigation by extending Walker_Nav_Menu

I have the following menu in my header: <?php $args = array( 'menu' => 'Main Menu', 'container' => false, 'depth' => 1, 'items_wrap' => ...
2
votes
1answer
423 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
733 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
830 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 ...