824 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+5 more
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
  • Has referred 100+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+9 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
226 posts
  • Won a Most Wanted contest
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $750,000+ on Envato Market
  • Had an item featured on Envato Market
+10 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;}
824 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+5 more
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?

824 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+5 more
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

824 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+5 more
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
  • Has been part of the Envato Community for over 4 years
  • Has referred 10+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
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

824 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+5 more
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
226 posts
  • Won a Most Wanted contest
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $750,000+ on Envato Market
  • Had an item featured on Envato Market
+10 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>
824 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+5 more
Gareth_Gillman says

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

Thanks for your help

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by