How to create Background Category with Different Color in wordpress
First go to the post and checklist what category you want to show Here I will display "WordPress"
Find This Code on your own Thame:
<?php
if(has_term('WordPress', 'category')){
echo '<li><a href="/category/wordpress" style="background:#e96767">Wordpress</a></li>';
}else{
} ?>
You see there is code like this right. ('WordPress', 'category'), in WordPress it is the category you choose to color. And in Category it is Taxonomy, so if you use custom taxonomy yourself you just change the Category section with the taxonomy you make on your theme
To change the color Change the following color code with your own color code # e96767
The result Will be like this, to beautify please combine with your css Enough for today thanks
No comments