The Navigation Menus system is adding a lot of classes, including matching current page (rather intelligently, it will even try to detect custom URLs, that were input explicitly).
The simplest class to make use of is current-menu-item
, but there are quite a few more dealing with parents/ancestors and more.
Codex has them documented at wp_nav_menu()
> Menu Item CSS Classes.
Related Posts:
- Where is definied the theme location for the main menu in a WordPress template?
- Some doubts about WordPress handle the horizontal main menu visualization
- Why nav_menu_css_class doesn’t work with apply_filters?
- How to add CSS class to custom logo?
- How to add custom css file in theme?
- Do I actually need to link my theme’s style.css in the theme files
- CSS classes for theme
- Add custom classes to anchor in wp_nav_menu
- Are the WordPress Core CSS styles really all nessesary?
- Why I can’t add a CSS style in this WordPress theme?
- How to make a theme with more than one CSS file?
- Editing the custom background CSS
- Select menu on browser resize
- CSS in child theme not overriding the parent theme [closed]
- How to add (css) classes to only one wp_nav_menu()?
- Displaying wp menus by name without using theme locations
- Setting a Default ‘Theme Location’ When Creating a Menu
- Do I really need the div class entry?
- Custom Nav Walker Displaying Values in Sub Menu
- Sub folder CSS that’s read by Admin panel
- CSS won’t style output of wp_nav_menu() correctly
- Dequeue a style file which is making website load slow!
- My Admin bar covers my sticky navbar [closed]
- Theme Loading Into Dashboard
- How to make theme elements customizable in wordpress?
- How to edit my theme for full width?
- Which html elements should be styled in wordpress theme
- Font Awesome 5 Free – far working but fas is not? [closed]
- WordPress Unite Theme: Footer isn’t sticking [closed]
- Where am I doing wrong in my theme menu?
- How to Find the Page the Front Page is Using?
- How to place HTML tags in content from the_content()?
- What is the meaning of WordPress’s recommended css classes and where are they applied?
- Admin: sub menu doesnt display under apperance when activate my themes
- 3 Level Deep Navigation Menu Not Showing All Levels
- Template for landing pages
- Theming Using Bootstrap Glyphicons and WordPress Dashicons
- How to add menù section to my WordPress template?
- Having issue with WordPress wp_enqueue_style
- Thesis -style Navigation
- How can I wrap all blog posts image with
- theme style is applied on the dhasboard rather than the website
- How to track a users last visited page?
- LESS not working in WordPress [closed]
- A post with a clear:both in its css destroy the theme design, and the sidebar is moved to the bottom
- Why is my container argument not working for wp_nav_menu() [closed]
- Why I obtain different visualization when I run the website on my local machine and on remote server?
- Can’t change theme name
- How to use the _S framework
- Parent/Child pages
- .current_page_ancestor broken in Twenty Eleven
- WordPress Animation Adjustments
- Is there a list of default generated Gutenberg block CSS? Unable to align video blocks
- how to create/register menu items that can be added to menus later
- 3 Level Menu Navigation (3rd Level not displaying)
- Theme: dropdown hover menu not showing up in IE/Edge
- Pages not displaying as sections on static page
- How can I fix my theme header for my CSS stylesheet?
- Creating a theme just to deploy a single page
- Menu names not getting translated
- How to generate a rtl.css file for themes?
- WordPress Twenty-Fourteen: How to Remove Home Page Header Image from Other Pages
- wp_editor some functionality not working on custom theme
- One-Page WordPress Template
- How to create multiple pages in a client theme?
- Primary Menu Showing All Pages With No Sub-Nav
- Can you create a custom page with content in the center already defined?
- What’s the policy for building a theme that doesn’t support widgets/menus?
- Why the slideshow is not shown in my theme?
- How get the 10 most viewed pages (not post)
- How can I change the title of the Home link in the navigation bar?
- adding navigation to genesis themes
- Standard Way To Do Custom Work Within A Page?
- Custom link color or stylesheets
- How to make navigation a list without a plugin? [duplicate]
- How do I middle-align my header menu items in WordPress [closed]
- How to highlight current menu bar base on the URL?
- What is The Best Way to Make Parallax header effect for wordpress theme ?? pure CSS or using JavaScript? [closed]
- How to automatically set a Template Page Name next to a page in menu screen such as WooCommerce pages, front page, or posts page in wordpress?
- Dynamic nav menu with icons [closed]
- Where do I find the functions triggered within a hook?
- Should I update my _s theme?
- Displaying part of every child page?
- WordPress 5.8 update problem custom theme styles are overridden by core styles common.min.css
- How to correctly add JQuery in a WP theme?
- how to change a theme slug
- Weekly background code not working
- How to add code in the content area in a WordPress theme?
- WordPress theme switcher
- Issue on Adding A Class to Bootstrap Navbar Walker Dropdown
- Renaming a theme so it aids SEO and the theme used is hidden
- How to rotate every letter in a title
- How to modify mobile nav menu text in theme
- New to WordPress – Read the Codex, Other Docs; Still Confused
- CSS preprocessor file messed up after compiled
- Why in this WordPress theme I can’t see the Main Menu?
- Custom theme – pages in menu
- How to change a local wordpress installation xml export file urls? and change them to what if you don’t have a live website?
- wp_nav_menu custom walker class
- How do I send out an update for my custom wordpress theme?