V
V
viktoria20202018-10-09 22:15:37
WordPress
viktoria2020, 2018-10-09 22:15:37

WordPress. How to highlight category links with different colors?

5bbd075264c58427046666.jpeg
Hello, please explain how to make rubric links like on this site plopolki.info/us

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Fruit_Fellow, 2018-10-09
@Fruit_Fellow

colorful categories

A
Angry Negro, 2018-10-09
@TOA

Install Advanced Custom Fields (wp plugin) and create an additional field in it to customize the rubric, select "color" as the field type. And yes, install ACF PHP right away (it's a code visualizer for ACF).
So. Now just somehow output the categories in the cycle: Add to your tag the style="background: attribute: AND ENTER THE RECEIVED ACF CODE HERE "
It should look something like this:

<div class="pumpum" style="background: <?php echo get_fields('colorforrubric')?>">
Название рубрики </div>

This is the most interesting and functional solution.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question