• hi all, i’m amateur for wordpress.

    i have theme html, and this menu can be responsive.
    but, if a version theme wordpress, this menu can’t be responsive.

    this my menu theme html

    <ul id="mainmenu">
                            <li><a href="#">Home</a></li>
                            <li><a href="#">Course</a>
                                <ul>
                                    <li><a href="#">Course List</a>
                                </ul>
                            </li>
                            <li><a href="#">Plans</a></li>
                            <li><a href="#">News</a>
                                <ul>
                                    <li><a href="#">News List</a></li>
                                </ul>
                            </li>
                            <li><a href="#">Fullwidth</a></li>
                            <li><a href="#">Gallery</a></li>
                            <li><a href="#">Contact</a></li>
    
                        </ul>

    and this my code for menu wordpress

    <ul id="mainmenu">
                            <?php wp_nav_menu(array(
                                'theme_location'    => 'primary',
                             ); ?>
    
                        </ul>

    anyone can help me? please..

    [ No bumping please. ]

Viewing 15 replies - 1 through 15 (of 16 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Have you read through the codex to see how that template tag works?

    That template tag already outputs an unordered list of menu items depending on which theme_location you are using. It really just depends on how you have that menu structured.

    Thread Starter afrila gunadi

    (@afrila-gunadi)

    thank you for replying.

    I’ve read it, and I am still trying to understand.

    according to you, what it lacks in wp_nav_menu array?

    thanks ??

    Is this a theme you made or are you using a theme already made by someone? Also, if you don’t want to deal with code, I suggest using this plugin: Responsive Menu.

    Thread Starter afrila gunadi

    (@afrila-gunadi)

    html theme made ??someone, for the version of wordpress, which made ??me.

    thank you for you advice ??

    but, I must to deal with code.

    I see. Well, if you want to deal with code then you need to use media queries to make your menu responsive. If you don’t know how to use media queries, then read this tutorial.

    Thread Starter afrila gunadi

    (@afrila-gunadi)

    oke, i’ll will check.

    OK. If you have any further questions about this topic, please do not hesitate to ask!

    Thread Starter afrila gunadi

    (@afrila-gunadi)

    hy, menu has been responsive. but i have a new problem.

    did u know, how to override file in header.php ?

    if u know, please read >> this ..

    thanks in advance ??

    Yes, it is simple to override the header.php that is in your theme. To do this, you must create a child theme first. Here’s a guide on how to create your own child theme.

    Once you create a child theme, you can copy the header.php file from the parent theme folder and put it in your child theme folder. Then you can safely edit this file.

    Is this a theme you made or are you using a theme already made by someone? Also, if you don’t want to deal with code, I suggest using this plugin:

    Thread Starter afrila gunadi

    (@afrila-gunadi)

    respectyoda : mmmm.. is there another way other than making child themes? ??

    phusipr01 :
    html theme made ??someone, for the version of wordpress, which made ??me.
    thank you for you advice ??

    but, I must to deal with code.

    Earlier you said…

    html theme made ??someone, for the version of wordpress, which made ??me.

    If this is a custom theme that you modified then you can modify the header.php file. Otherwise, make a child theme as this is the safest way to do it.

    Thread Starter afrila gunadi

    (@afrila-gunadi)

    okay i’ll try it.

    what do you think. the problem duplicated menu when responsive, it’s due override css ( without make child theme) ? or Is there something wrong with the codex wp_nav_menu in header.php ?

    There is nothing wrong with the wp_nav_menu function. You just need to use CSS, more specifically, you need to use media queries to make adjustments at different browser widths. Read this tutorial on how to use media queries.

    Thread Starter afrila gunadi

    (@afrila-gunadi)

    okay, I already understand. thank you for all the answers ??

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘how to be responsive menu with wp_nav_menu’ is closed to new replies.