Archived topic
Can we style list of tags?
5 replies · Started by Kemo on October 8, 2019
url: https://ministryofjapan.com/geisha/comparison-of-tokyo-rokkagai-the-six-geisha-districts-in-tokyo/
I want to be able to style the tags that are listed on the bottom of the post and are comma-separated. Can we lose the comma and give each tag a CSS class?
I want to style them to turn them from a list into kind of buttons.
from this: https://i.imgur.com/8icqonJ.png
to this: https://i.imgur.com/CAOWsTm.jpg
thanks!
Hi there,
To give each tag a separate class and style each tag differently would be a bit difficult.
But if the goal is to style them all the same as your example here:
https://ministryofjapan.com/geisha/comparison-of-tokyo-rokkagai-the-six-geisha-districts-in-tokyo/
Then that's certainly do-able. Can you confirm that's what you are looking for?
the url that you refer to is my site, I want to give each tag the same class and just style them as grey "buttons" like here: https://i.imgur.com/CAOWsTm.jpg — and I know how to do this with css once i have the darn class on them.
You actually don't need a special class to style them.
Simply do this:
.tags-links a {
background-color: #000000;
padding: 2px;
}
As for commas, Tom provided a PHP function here:
https://generatepress.com/forums/topic/move-entry-meta-below-the-entry-tags/#post-669447
Adding PHP: https://docs.generatepress.com/article/adding-php/
Let me know if this helps :)
thanks a lot
No problem :)