WP SITES

2948 Tutorials & 189 Plugins

Inline Style Nav Menu Items For Each Category Using walker_nav_menu_start_el

The code in this download folder adds a color picker to your Edit Category Pages which you can set to style each category nav menu item a different color, no plugins required and no CSS needed.

Demo Video

Shows a color picker added to the Edit Category screen enabling the user to choose the link colors for category links added to the nav menu.

Tested using the Genesis Sample child theme by StudioPress however will work in any WordPress theme.

Installation Steps

There’s 2 steps :

  1. # Copy & paste the PHP code ( without the opening PHP tag ) to the end of your child themes functions.php file.
  2.  

  3. # On the Edit Category Page, choose the color you want to use to style the nav menu item for that category link.
  4.  

Download Folder

Adding Inline Style To HTML Tags

Here’s another way to add inline styles directly into your HTML :

Related Tutorials

Was This Tutorial Helpful?