Activate Main Menu Item when I am in a child page

[ad_1]

Hi,

I created I created some custom post types and accordingly a main menu with some custom link named by these CPT names and links.

example.com/cpt

Each CPT has some posts inside it, and I created another menu for each post type with its item as the posts names of each.

example.com/cpt/ (as archive page)
example.com/cpt/post1
example.com/cpt/post2
example.com/cpt/post3

When I go to the archive page it is ok, the main menu item become highlighted (active), but when I go to child posts, the main menu item goes back to normal color.

Please let me know if I can do this inside Blocksy setting or I can do this with CSS, or other code snippet?

Thanks.

https://ibb.co/MN86wzN
https://ibb.co/VLMVL7Q

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer