506 posts
  • Bought between 10 and 49 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • United Kingdom
Gareth_Gillman says

I am doing a html > WP convert and I am stuck on the menu.

On this page, in the menu it shows the sub nav for that page.

How would I do that using the WP drag ‘n drop menu system? I know I could create different menu’s for each page with a sub nav and use the is_page() function but is it possible using one menu?

3256 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Exclusive Author
  • Interviewed on the Envato Notes blog
  • Beta Tester
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
+4 more
ParkerAndKent says

You must use the wp_nav_menu function http://codex.wordpress.org/Function_Reference/wp_nav_menu and try to adapt its output to your needs, also if is better to do the opposite.

Parker

ProgressionStudios
ProgressionStudios Recent Posts Threads Started
221 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Author had a Free File of the Month
  • Attended a Community Meetup
  • Exclusive Author
  • Interviewed on the Envato Notes blog
  • United States
+4 more
ProgressionStudios says

You just want to display the sub-pages when you are on that page only correct? You can use CSS and keep it simple. It would be something like this:

ul ul {display:none;}
ul li.current-menu-item ul, ul li.current_page_item ul, ul li.current-menu-parent ul {display:block;}
506 posts
  • Bought between 10 and 49 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • United Kingdom
Gareth_Gillman says

You must use the wp_nav_menu function http://codex.wordpress.org/Function_Reference/wp_nav_menu and try to adapt its output to your needs, also if is better to do the opposite. Parker

I am using wp_nav_menu, know any sites that will have a guide on how to accomplish this?

506 posts
  • Bought between 10 and 49 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • United Kingdom
Gareth_Gillman says

You just want to display the sub-pages when you are on that page only correct? You can use CSS and keep it simple. It would be something like this: ul ul {display:none;}
ul li.current-menu-item ul, ul li.current_page_item ul, ul li.current-menu-parent ul {display:block;}

Brilliant, thank you. Worked a treat

506 posts
  • Bought between 10 and 49 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • United Kingdom
Gareth_Gillman says

Having an issue with the css, can’t get the sub nav to display under the open menu like the link I posted above.

The link is http://www.garethgillman.co.uk/wordpress/wm/uk-visa-service/.

Any help would be appreciated.

147 posts
  • Bought between 10 and 49 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 10 and 49 users
  • Sold between 250 000 and 1 000 000 dollars
FlexiPress says

if you need vertical style – drop down menu – and supports more than three levels, you can try jquery superfish…

http://users.tpg.com.au/j_birch/plugins/superfish/

integrating superfish with wp_nav_menu is easy,,,

wp_nav_menu( array( 'theme_location' => 'your-menu-location', 'menu_class' => 'superfish' ) );

http://codex.wordpress.org/Function_Reference/wp_nav_menu

506 posts
  • Bought between 10 and 49 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • United Kingdom
Gareth_Gillman says

Bump, can anyone help?

I am sure it’s a css issue but can’t find the code to make it work.

ProgressionStudios
ProgressionStudios Recent Posts Threads Started
221 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Author had a Free File of the Month
  • Attended a Community Meetup
  • Exclusive Author
  • Interviewed on the Envato Notes blog
  • United States
+4 more
ProgressionStudios says

It looks like a simple CSS issue your having. The unordered list is open inside of your list item. I assume your CSS styles don’t account for this. The actual show/hide looks like it’s working correctly.

The UL list is showing up like so:
<li><a href="">List item open</a> <ul><li><a href="">Content 2</a></li></ul></li>
506 posts
  • Bought between 10 and 49 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • United Kingdom
Gareth_Gillman says

I fixed it (finally) but changing the code slightly.

Thanks for your help

by
by
by
by
by
by