This tutorial provides the code to automatically add space separated category slugs as classes to nav menu items that link to single posts in WordPress.
Could be useful for styling the menu items based on categories when using a plugin like Category Posts in Custom Menu.
Add the following in child theme's functions.php:
To view the full content, please sign up for the membership.
Already a member? Log in below or here.
Find my tutorials helpful and wish to donate?
Please log in again. The login page will open in a new window. After logging in you can close it and return to this page.