Time for action – creating a new WordPress menu

As we have the correct code in place in our theme file, we can set up our menu in the Menus admin screen.

  1. Open the Menus screen by going to Appearance | Menus to see the Menus admin screen as shown in the following screenshot:
    Time for action – creating a new WordPress menu
  2. At the moment, there isn't a menu defined. To add one, type the name of your menu in the Menu Name field at the top-right side. For our site, let's call the menu main-menu.
  3. Click on the Save Menu button. You will see a message telling you that the menu has been successfully created and you'll see its name in a tab above the Menu Name field. Good job!
  4. In the Theme Locations box, select your menu from the select field (make sure you've followed step 3 and saved your menu first or it won't appear in the select field).
  5. Click on the Save button in the Theme Locations box.

What just happened?

We created a new menu and saved it. Now let's add some links to it.

Adding pages and other content to our menu

You can add all sorts of content to your menus including pages, posts, categories, and custom links. Let's start by adding some static pages.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset