Advice on custom Taxonomy in menu

Hi!

Through ACF I’ve created a custom posttype and a taxonomy. The taxonomy holds 3 items.
There are 12 pages of this CPT and each post has one or more taxonomy-items (categories).
What I would like to achieve is to display each of the three taxonomy items (categories) in a menu (which was fairly easy), and have a dropdown on each category that shows all the pages linked to that category.
I can think of multiple ways to try and achieve that, but I want to stay as close to how Cornerstone is designed as possible.

To illustrate: there are 12 pages (CPT) and all have a taxonomy-item attached (e.g. assigned a category)

I’d like to display them in a Cornerstone menu as a dropdown like this

What’s the advised route to take, which uses the full potential of Cornerstone and auto-add’s new posts and/or categories?

Thanks in advance!

Hello @dhunink,

Thanks for writing to us.

You can add taxonomy terms or categories to your menu by following these steps:

  1. Go to your WordPress menu settings and click on Screen Options at the top.

  2. Enable the specific taxonomy or category you want to add as menu items.

  3. Once enabled, the taxonomy will appear on the left side with its terms listed. Select the terms you want and click Add to Menu.

Save the menu, and then use a navigation element such as Navigation Inline or Navigation Dropdown, etc, to display it on your site using the Cornerstone page builder.

Hope it helps
Thanks

Hi!

I’ve done exactly that and the selected taxonomy terms do show up inside the Cornerstone Navigation elements, but they don’t display drop-down with the pages that have those taxonomies. That’s the challenge I’m facing, and I’m not sure what the best route forward would be, inside Cornerstone.

Hello @dhunink,

Going to the Appearance > Menus, as pointed out by @Prakash_s, you will have to manually insert the Custom Taxonomy and the pages under each taxonomy.

When you want to display the custom post type for each taxonomy, using the Looper Provider Query Builder should allow you to achieve what you are trying to accomplish. Take, for example, the element structure below:

Section
  Row
    Column
        Div - Looper Provider All Terms (Looper to display the taxonomy)
           Dropdown - Looper Consumer (display taxonomy item)
              Div - Looper Provider Query String (under the current taxonomy)
                 Div - Looper Consumer 
                     Button - Link to custom post item 

Hope this makes sense.

Hi @ruenel,

I did thought about using Loopers, but was not sure if that indeed was the advised way to go. I was kind of surprised that pages added to a taxonomy are not automatic added to submenu’s, hence my question.

Thanks for pointing me in the right direction. Your description definitely makes sense.
However, that only covers adding a single dropdown for each taxonomy item. I’m perfectly okay with building a Looper, but also want to incorporate that inside a default Pro menu-element, since that has all the styling and responsive behavior done already. What’s your advice on using a Menu-Element with taxonomie cateogries and displaying their items?

In the mean time, may this be an interesting challenge for the developers to support auto-added taxonomy sub-pages in menus, or is that just something WP isn’t supporting and therefore won’t be something to be supported in Pro?

Hello @dhunink,

At the moment, when going to Appearance > Menus, adding the menu items is to be done manually. This means that using the Menu element is not possible to automatically add the custom taxonomies along with the pages under each taxonomy. What you have in mind is WP’s current limitation.

With the Loopers, you can add the items under each taxonomy using the Dropdown, like I have shown in my previous reply.

Thanks.