Very Easy Menu for WordPress Themes

Add menu support in wordpress theme

To Create a stylish menu for your WordPress theme you need a few things.

  • You Need to add function for menu theme support in your functions.php file
  • You need to create the menu from – Appearance -> Menus
  • You Need to display the code in your theme
  • You need to add style to this menu

Open you funtions.php and add these lines to your code:

function register_my_menu() {
register_nav_menu('your_new_menu',__( 'You Header Menu' ));
add_action( 'init', 'register_my_menu' );

Open the file you want to display this menu and add the following code in div style or class you prefer.

<?php wp_nav_menu( array( 'theme_location' => 'your_new_menu' ) ); ?>

Now  your WordPress Menu will be displayed at the place you add the code and you need to add some style. If you want to see the results from the code above visit the Demo of Add Menu Support in Your WordPress Theme from scratch.


Related Articles

Facebook Comments

Leave a Reply

Your email address will not be published. Required fields are marked *