Styling get_category… Splitting it…
-
I’ve applied a style around my “get_category” as below;
<span class="<?php $category = get_the_category(); echo $category[0]->category_nicename; ?>-highlight"> <?php the_category(',') ?></span>
The problem is this applies the same style to all the categories listed. Can I do something like this…
<span class="<?php $category = get_the_category(); echo $category[0]->category_nicename; ?>-highlight"> <?php the_category('</span>, <span class="<?php $category = get_the_category(); echo $category[0]->category_nicename; ?>-highlight">') ?></span>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Styling get_category… Splitting it…’ is closed to new replies.