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 :
- # Copy & paste the the PHP code ( without the opening PHP tag ) to the end of your child themes functions.php file.
- # Install the Advanced Custom Fields plugin ( free or pro version ) and import the acf-107783.json file.
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