Archived topic
Style Tags and Cats
8 replies · Started by breaked on July 4, 2017
Hi Tom,
I wan't to style the tags and cats under my posts. Something like a button look.
Maybe you can help me?
Something like here at the buttom, called "SCHLAGWORTE": https://rockxx.de/generatepress-ein-kostenfreies-wordpress-theme/
Hi there,
Try something like this:
.cat-links a,
.tags-links a,
.comments-link a {
border: 1px solid #000;
padding: 3px;
}
.cat-links a:hover,
.tags-links a:hover,
.comments-link a:hover {
background-color: #666;
}
footer.entry-meta {
line-height: 2.5;
}
Adding CSS: https://docs.generatepress.com/article/adding-css/
Thanks, looks good!
But.. there are commas between each words. Can I delete them?
And I'm able to create a button for writing comments also?
We can use a filter to do that quite easily:
add_filter( 'generate_tag_list_output', 'tu_adjust_tag_list_separator' );
function tu_adjust_tag_list_separator() {
$tags_list = get_the_tag_list( '', ' ' );
printf( '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
_x( 'Tags', 'Used before tag names.', 'generatepress' ),
$tags_list
);
}
add_filter( 'generate_category_list_output', 'tu_adjust_category_list_separator' );
function tu_adjust_category_list_separator() {
$categories_list = get_the_category_list( ' ' );
printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
_x( 'Categories', 'Used before category names.', 'generatepress' ),
$categories_list
);
}
Great as always!!!
Thanks.
Ah... whats about the button for comments?! It's possible?
Edited the code above: https://generatepress.com/forums/topic/style-tags-and-cats/#post-344140
Perfect!
Awesome!