This members-only tutorial for Oxygen provides the steps to register a custom condition using which menus can be shown conditionally on Pages based on "Menu Category" taxonomy selected in the Page edit screens.

Page Edit Screen

This condition is meant to be used for the Template that applies to all static Pages or when editing individual Pages in Oxygen editor.

The selected menu from the list of dynamically generated WP menus will be checked against the menu category set for that Page.

Use Case

Add several Menu components for the various Pages (Ex.: "About Menu" for all about Pages, "Services Menu" for all service pages) and this condition will enable you to load the corresponding menu.

Step 1

Install and activate Custom Post Type UI plugin.

Go to CPT UI > Add/Edit Taxonomies.

Add a new taxonomy like so:

Set Hierarchical to True so it behaves like categories with checkboxes.

Step 2

Install and activate Code Snippets plugin.

Go to Snippets > Add New.

Title: [Condition] Menu Category for Pages

Code:

This is a premium members-only content.

To view the rest of the content, please sign up for membership ($37/month or $399 one-time).

Already a member? Log in below or here.

Need help implementing a tutorial in your site or want to hire me for custom work?

HIRE ME

Find the article helpful and wish to donate?

DONATE

Comments

For adding code blocks wrap the code in three backticks. Markdown should work.
Provide a URL of your site/webpage if something is not working.
magnifiercross
>
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram
%d bloggers like this: