Inline Style Post Category Links Differently Using Color Picker

The code in this download folder enables you use the color picker on the Edit Category page to style your post category links different colors.

Once you install the PHP code, all post category links will be styled without the need to add any CSS and each link will be styled differently regardless of how many categories you assign to each post.

Works with any taxonomy type.

Demo Video

Shows you how to use the color picker on the edit category page to set the post category link colors o single posts and archive page types including category and home archive pages.

Tested using the Genesis Sample child theme by StudioPress however will work in any Genesis child theme and any WordPress theme if you change the hook.

Installation Steps

There’s 2 steps :

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

  3. # Install the Advanced Custom Fields plugin ( free or pro version ) and import the acf-107783.json file.
  4.  

Download Folder

Usage With Other Taxonomies

Simply swap out the value for the $post_categories variable in the code and change the category taxonomy parameter to match your taxonomy.

$post_categories = get_the_terms( $post->ID, 'category' );

Uses get_the_terms

Related Tutorials

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.