When I click in top navigation menu and page changes, menu item that I clicked on gets bold as current-menu-item
class gets assigned to that particular element.
How does WordPress does this?
Leave a Reply
You must be logged in to post a comment.
When I click in top navigation menu and page changes, menu item that I clicked on gets bold as current-menu-item
class gets assigned to that particular element.
How does WordPress does this?
You must be logged in to post a comment.
It depends on your theme, but you can override it if you like. See the wp_nav_menu codex page. Here you can specify the class for the active menu element.
If you just want to change the styling then you can modify the style.css file in your theme folder.
If you want the actual code that gets executed then I’m not sure where in the core php files that is handled, but I imagine it is something pretty ordinary. For example,