Articles of sub menu

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 taxonomies for the boats. What I want to do now is, display every new boat model as a sub […]

wp_list_pages: only show subpages on the parent page?

I’m using wp_list_pages(‘title_li=’) on my site. Some of my pages do have subpages, however I don’t want to list them unitl I’m on an actual parent page that has subpages. So imagine my front-page: — About Us — Gallery — Kitchen — Disclaimer When clicking on Gallery (and Gallery has two subpages) I want them to be listed […]

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: Home About – Subpage 1 – Subpage 2 – Subpage 3 Contact I would like to set up a […]

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 displayed in the menu but not in a sub menu. With wp_nav_menu(‘depth’ => 3) it don’t append all items. So, […]

How to have custom menu Item CSS Classes for wp_page_menu() or wp_list_pages()

I want to add custom classes to my menu items. For every subpage I show its siblings as a navigation: global $post; if ( is_page() && $post->post_parent ) { $args = array( ‘sort_column’ => ‘menu_order’, ‘title_li’ => ”, ‘child_of’=> $post->post_parent ); $childpages = wp_list_pages($args ); } This gives me a list with links. I want […]

Category menu item and its last 10 posts as sub-menu

i have some posts categories as element of a main navigation menu, and i’d like to display the ten lasts posts of this category as sub menu. ex: Category1 Lastpost1 Lastpost2 The main menu is build in the admin panel, and i’m wondering if there is a hook or something to achieve that automatically. I […]

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 Child C. Other than that, I’m not sure if this is something […]

Change top level menu item to point to custom submenu item

I’m using a plugin called CMS Page Order http://wordpress.org/extend/plugins/cms-page-order/ (Now referred to as CPO) It’s pretty simple, the said plugin adds a new item to the submenu of every custom post type. The menu item leads to a page where you can reorder the posts of the certain post type. I’ve added so that you […]

Subpages return 404 error

I set permanent link as http://site.com/%postname%/. I’m talking about this type of pages: http://codex.wordpress.org/Pages_Screen. All first level pages work fine. But subpages don’t. For the first level page I get url like this: http://site.com/page/. For the second level page – http://site.com/page/subpage/. If I use permanent link http://site.com/?p=123 or http://site.com/2012/02/29/sample-post/, subpage works fine then. How does […]

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 nav is including the main nav pages as well. the two menus contain only the pages i want per nav […]