admin管理员组文章数量:1122832
I am writing a Wordpress site using the block editor (Spectra One theme).
I have a menu item called News. When I click on it the News page appears and the News menu item is highlighted.
The News page has links to other news pages on it, e.g. a link to a page containing News Item 1, a link to a page containing News Item 2 etc. As soon as I click on one of these links however, the News menu item loses its highlighting.
How do I retain the highlighting of the News menu item?
Is it possible to do this via css?
(I know I can retain the highlighting of the News menu item if I add News Item 1, News Item 2 etc. to a submenu, but I don't want to do this.)
I thought the answer might lie in assigning the News page as the parent page of News Item 1, News Item 2 etc. and using current-page-ancestor but have got nowhere with this. Probably I am misunderstanding something basic. A potential solution I have found on the web involves adding code to the footer.php file but as it is a block theme it doesn't have a footer.php file.
I would be eternally grateful for any help.
本文标签: cssHow do I highlight a Wordpress Menu Item for a page that is not on the Menu
版权声明:本文标题:css - How do I highlight a Wordpress Menu Item for a page that is not on the Menu? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736301549a1931212.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论