WordPress Tutorial: Using Categories To Create A One Link Menu Item

in #utopian-io8 years ago (edited)


Image Source

A drop-down main header menu works well when you start out your WordPress website. If you're starting from a point where you still need to learn how to build your WordPress menu, there's an informative tutorial to follow by @farahnabilla.

As you continue to add posts to the main menu item as sub-items, the drop-down list keeps growing longer. Soon it will run down off the page. One answer to the run on drop-down menu is to do as @farahnabilla suggests. Use categories as sub-items in your drop-down menu. This will collect posts into separate categories, and shorten the drop-down list.

Another method of dealing with a run on drop-down menu is to do away with sub items completely. You can do this by assigning a new category to all posts you want to show when visitors follow the menu link. Visitors are thereby brought to a new page that displays all the posts in the new category you have assigned.

Goals Of The Tutorial

By following this tutorial the reader will know how to:

  1. Create a new category on their WordPress website.
  2. Assign existing posts in bulk to the new category.
  3. Apply an existing category to existing posts in bulk.
  4. Set a new or existing category as a single link item in your header menu.
  5. Verify to make sure the process completes successfully.

Step 1 – Create A New Category On Your WordPress Website

To be clear, this step may not be necessary if you already have a category that you want to use for a single menu item. For instance, you may already have an existing blog category that you want to set as a single linked menu item. Go ahead and skip to step two.

If you want to create a brand new category for your single menu item, start here. Begin by logging into your WordPress website with the role of administrator. On your WordPress drop-down menu, move your cursor and hover over Posts. This will open a box on the right. Move your cursor over and click on Categories.

You will now come to a new page labeled “Categories” in the top left. Just below the page title, you will see Add New Category with following command options. Start by entering the name of the new category you want to create. I put Angler Tutorials in the image below. You choose what works for your needs, be it Blog or another chosen category.

Note: Remember that the category name you choose will appear as you write it in your top menu.

Other Command Options

There are several other command options at your disposal on the WordPress Categories page. Besides a command box for Name, you will find boxes labeled Slug, Parent Category, and Description.

Slug – The slug is the URL version of the category name. It has all lower case letters and dashes to separate words. If you choose a one word name for your new category, simple enter it as a lower case word. If you have more than one word, use lower case and dashes in between. See the example in the image below.

Parent Category – If you want your new category to help organize a larger category, choose that existing category here. You will hierarchy in this category or a sub category, one might say. Leave it blank as I did if you want the category to stand by itself. You can always change this later.

Description – The description box is optional. You may write a short explanation about the category here.

Finally, off to the right, you will see a list of all your existing posts. You may click any of the post boxes if you want to assign them to your newly created category. Don't forget to click the blue box in the bottom left that reads “Add New Category”, when you are ready to complete the process. Check the examples in the following image.

Step 2 – Assigning Posts To An Existing Category In Bulk

In this situation, you already have a category you want to use for a single menu item. You may have also just created a new category, and can assign existing posts to it in the same manner. To begin, move your cursor back over to your WordPress drop-down menu under Posts, and click on All Posts.

You will arrive at a new page labeled “Posts”. Below the page title you will see a list of your posts with boxes next to them. There will also be quite a large number of different commands. For this example, I will use the Blog category. It already exists and several posts are currently assigned to it.

You can easily see which categories are assigned to each post by checking down the Categories column. See the examples in the image below where posts already assigned to the Blog category are boxed in red.

Although some of the posts are already in the Blog category, there are others that need to be added. Go down the list of posts and check the boxes of any that you want to add to your existing or new category. See the examples below.

Once you check the posts you want to add to an existing category, go back up to the top of the page. In the top left of the page you'll see an option box that reads, “Bulk Actions”. Open up that box and select “Edit” by clicking. To complete the action, click on the box that reads, “Apply”. Find the correct locations marked in the following image.

When you click Apply, a new panel will open up directly under the command boxes. It will show the posts you have check marked with a small x. Click that x to abort any one of them. If you are happy with your post selections, click the box of the category you want to add them to. In my example I choose Blog. Complete the process by clicking the blue box in the right corner that reads, “Update”.

After you click update, you will redirect back to the Posts page. There you can verify that your selected posts did indeed get assigned to the category you desired.

Step 3 – Setting Your Chosen Category As A Single Menu Item

Now that you've prepared your chosen category (or created a new one) and added all the posts to it that you want to appear, it's time to add that category to your menu.

Begin by moving your cursor again to the WordPress drop-down menu. Hover over Appearance and more selections will open on the right. Move your cursor and click on Menus.

Once you arrive at the Menus page, you'll likely want to remove the old menu items with too many sub items before you add anything new. Do this by clicking the down arrow on each item, then clicking the red remove text. Go through and remove all the menu items that will be included in your new category menu item.

Now return to the top left of the Menus page and find the box that reads Categories. Click on the down arrow and a panel will open revealing all your categories with a check box next to each. For my example I check the Blog category. Click the box at the bottom of the panel that reads, “Add to Menu” to complete. See below.

Scroll down to the bottom of your menu and you'll find you new Category menu item. Grab the item by left clicking and drag it anywhere in the menu you want to place it. Be sure you keep it full size as you drag the item, or it will be set as a sub item.

You can see in the example that I dragged the new Blog category item up two spots from the bottom. Remember to click the blue box that reads, “Save Menu”, to apply all your changes.

To verify that your efforts are a success, visit your website front end. Be sure to refresh if you had it open in your browser. Click on your new category menu item. You should be directed to a new category page with the assigned posts on display.

Final Thoughts

As your WordPress website develops, keeping a menu that's easy for visitors to navigate requires some attention. The drop-down menu becomes less effective as menu items run off the screen. Assigning posts to a single category for use as menu item is one answer to organizing the menu clutter.

Once your posts are assigned to a category you want as a main menu item, it's a fairly simple process to add that category to your menu. Visitors will no longer see drop-down choices when they hover over the menu item. Instead, clicking on it will bring them to a new page that displays the posts assigned to that category.

Hope you found the tutorial helpful. Leave a comment or contact me on Discord with any hangups or further questions. I'm happy to help out.

All Images Personal Screenshots Unless Cited

If You Enjoyed The Tutorial Please Show Your Support To @Inalittlewhile



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

inalittlewhile!! Thank you, your Post.

You are welcome.