24 posts
  • Has been part of the Envato Community for over 2 years
Theme-Titans says

Hello tf citizens i’m in need for a serious help i’m making this awsome theme have encountered a serious problem that i cannot fix. the theme i’m making is a responsive theme and has 2 nav menus the first nav menu is your regular menu with a format of < l i > < /li >< /ul> format.

and in the functions i use this wordpress functions to dynamically generate the menu items.

<?php wp_nav_menu( array( ‘theme_location’ => ‘header_menu’, ‘container’ => ‘false’, ‘items_wrap’ => ‘

    %3$s
’, )); ?>

now the second nav menu is in the format of < select > < option value=”index.html” >Homepage< /option > < option value=”about.html” >about us< /option > < /select >

My Problem is when dynamically generating menu items it displays this

< select > < l i> < option value=”index.html” >Homepage< /option > < /a >< /li > < l i > < option value=”about.html” >about us< /option > < /a > < /li > < /select >

how do i fix this, any solutions or other functions that i can use? please help me solve this.

124 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $10,000+ on Envato Market
  • Located in Belarus
  • Has collected 10+ items on Envato Market
+1 more
Themico says

Usually JavaScript solution used for this purpose:

http://github.com/mambows/mobilemenu

You only need to have your default menu with this script and it will automatically generate a select from it. Then show/hide your menu and show/hide select with media queries.

653 posts
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+5 more
UBLThemes says

Hello tf citizens i’m in need for a serious help i’m making this awsome theme have encountered a serious problem that i cannot fix. the theme i’m making is a responsive theme and has 2 nav menus the first nav menu is your regular menu with a format of < l i > < /li >< /ul> format.

and in the functions i use this wordpress functions to dynamically generate the menu items.

<?php wp_nav_menu( array( ‘theme_location’ => ‘header_menu’, ‘container’ => ‘false’, ‘items_wrap’ => ‘

    %3$s
’, )); ?>

now the second nav menu is in the format of < select > < option value=”index.html” >Homepage< /option > < option value=”about.html” >about us< /option > < /select >

My Problem is when dynamically generating menu items it displays this

< select > < l i> < option value=”index.html” >Homepage< /option > < /a >< /li > < l i > < option value=”about.html” >about us< /option > < /a > < /li > < /select >

how do i fix this, any solutions or other functions that i can use? please help me solve this.

I use jquery to call the li id and convert to select and options. That way you get the select version even though the original coding is infact a div ul and li.

901 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
+4 more
Gareth_Gillman says

I would do the following:

Have 1 menu created, and in the file do a call such as this code, which will display the screen size, then in WP do a call to each screen size e.g.

if screen size is larger than xx then show menu 1

if screen size is less than xx show menu 2

Menu one would be the wp_nav_menu code as in your post, menu 2 would be a the same wp_nav_menu code but with a custom walker added such as this

24 posts
  • Has been part of the Envato Community for over 2 years
Theme-Titans says

Wow! that was fast Thank you everyone for sharing your solutions i’ll try each and every solutions you shared and see what fits my style.

again thank you for your help guys.

3503 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $750,000+ on Envato Market
  • Located in United States
  • Helps us moderate the forums
+10 more
sevenspark Moderator says
24 posts
  • Has been part of the Envato Community for over 2 years
Theme-Titans says

Sweet! Cool plug thank you i’ll try this one looks promising.

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