Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the Conditional Menus plug-in to make WordPress display different menus on different pages

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

How to use the Conditional Menus plug-in to make WordPress display different menus on different pages, this article introduces the corresponding analysis and solutions in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

The menu is the basic content of every website, and it can help visitors find the page they need easily. However, on a site with a complex structure, you may want each set of pages to have a separate menu. To customize them in this way, you need a plug-in to create different menus and assign them to your page / page group.

Creating a separate menu for each page

It may be helpful to set up a separate menu for each page in the following situations:

You want to display the product page on the menu on the home page. Each product page has a specific menu with a submenu linked to the product information page. For example, the menu on the product page will contain information such as the price and country of origin of the corresponding product.

You have a website of chain stores, each of which is represented by a separate page. The menu on the home page will point to the store page. The page of each store has its own basic page menu, such as product, address, order, etc.

To make it easier to understand, I will take a fruit business website as an example. My site has a default menu on the home page, which points to two pages: Apple and Banana.

Conditional Menus plug-in tutorial

I'll use the Conditional Menus plug-in to create two other separate menus for these two pages. Here are the steps to complete it:

Step 1: install and activate the Conditional Menus plug-in

The Conditional Menus plug-in is free and is available on wordpress.org. You just need to install and activate it like all other free plug-ins.

Conditional Menus download address: https://litepress.cn/plugins/conditional-menus/

Next, go to the appearance > menu, switch to the administrative location, and you can see the + Conditional Menu added by the plug-in:

Step 2: create a menu

Now I'll create separate menus for the Apple and Banana pages. To do this, I go to appearance > menu > Edit menu > create a new menu.

Next, name the menu, select where the menu is displayed (I want to display it on Header), and then click create menu.

In the add menu items section, you need to add the page as a submenu. I'll add two pages to Apple Menu, Apple Origin and Apple Price. Click Save menu.

I will now perform the same steps to create a separate menu for the Banana page:

Step 3: set the menu to the appropriate page

Still in the appearance > menu, change to the administrative location and select + Conditional Menu:

Select a menu from the list (I chose Apple Menu). Click + condition to set the display location:

A new pop-up window will appear and you will see different tabs to choose from. You can choose to display menus in each category, article type, category, user role, or home page, 404 page, and so on.

I will select the Pages tab and the Apple page to set the menu to this page.

I would do the same thing with the Banana menu.

Finally, don't forget to click Save changes, or everything you've done will disappear.

Now I will go to the front end of WordPress to check the results.

As you can see, the home page, Apple page, and Banana page now have three different menus that I want.

Summary

As you can see, using the Conditional Menus plug-in to create different menus for different pages is simple and useful. In addition, the plug-in gives you the flexibility to create separate menus for article types, categories, taxonomies, user roles, and even 404 pages.

This is the answer to the question about how to use the Conditional Menus plug-in to let WordPress display different menus on different pages. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report