WordPress Custom/CMS Menus Tutorial - CurrantWeb

    Contact Us

    For advice or a free quotation, please call:

    02476 552 222

    Or please drop us a quick message.

    Please be assured your information will not be shared with any party outside of CurrantWeb.
    * Denotes a mandatory field

      Book A Demo

      To book a demo of our templates, simply make a booking request below:

      Please be assured your information will not be shared with any party outside of CurrantWeb.
      * Denotes a mandatory field

      WordPress Custom/CMS Menus Tutorial

      Share on facebook
      Share on google
      Share on twitter
      Share on linkedin

      Table of Contents

      Lets take a look at how you can use WordPress’ built-in Menu feature to create your own custom menus. WordPress menus allow you to customise and overwrite the default navigation bar that simply displays all CMS pages in alphabetical order. Assuming your theme supports WordPress Menus, you have the ability to:

      • Change the order of your navigation pages
      • Change the labels of your navigation tabs
      • Exclude pages you do not wish to display
      • Include categories, posts and custom links in your navigation
      • Nest pages to create sub-menus

      How to register your second menu

      Simply locate your functions.php file from within your theme folder, and apply the following code. You can append my reference of ‘Second Menu’ to a term of your choice:

      [php]
      function register_my_menus() {
      register_nav_menus(
      array( ‘second-menu’ => __( ‘Second Menu’ ) )
      );
      }
      add_action( ‘init’, ‘register_my_menus’ );
      [/php]

      The following code demonstrates the registration of both second and third custom menus.

      [php]

      function register_my_menus() {
      register_nav_menus(
      array( ‘second-menu’ => __( ‘Second Menu’ ),
      array( ‘third-menu’ => __( ‘Third Menu’ )
      )
      );
      }
      add_action( ‘init’, ‘register_my_menus’ );

      [/php]

      Deploying your menus

      By default, your initial custom menu will simply overwrite your primary navigation. If you’re registering additional menus for your theme then you’ll need to declare within your template where they should appear. To do this, simply use the following code below. In the video, I deploy this code within the footer.php include.

      [php]<?php wp_nav_menu( array( ‘theme_location’ => ‘second-menu’ ) ); ?>[/php]

      It’s as simple as that! For more information and options, head over the WordPress developer’s codex for menus.

      Recent Posts

      How to Start Affiliate Marketing

      Are you interested in getting into affiliate marketing? You are? We certainly don’t blame you. In today’s capricious economy and with the uncertainty of Brexit

      Read More »