1

I have converted my one page html website to wordpress theme. Index.html page is converted to header.php, index.php and footer.php .

Now I want to make a dynamic menu. I have registered my menu in WordPress and it I showing in the admin panel. When I create a new menu now the page is showing to add my menu there. How can I create that page?

1

1 Answer 1

0

You may need to register the menu via functions.php. If you dont have, create a file inside your theme as functions.php and paste the following code to register the menu.

register_nav_menus( array('my_nav' => __( 'Primary Navigation', 'dz theme' ),
    'secondary' => __('Secondary Navigation', 'dz theme') 
    ));

And you can call your primary menu as :

<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'my_nav' ) ); ?>
Sign up to request clarification or add additional context in comments.

2 Comments

i have registered my menu in functions.php. I have to create menu while i have header.php and also have index.php which consist of all othere div sections which are not i header.
Is that you need to create a secondary menu? @ShahbazAmin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.