Archived topic
Blog post tags-links in sidebar widgets
5 replies · Started by Megan on April 8, 2021
I am wanting to put the tags-links in the sidebar widget area instead of below the post on the single blog post page. How do I go about that?
Any help would be much appreciated!
Hi there,
it would require creating a shortcode.
1. Add this PHP Snippet to your site:
function db_taglist(){
return get_the_tag_list('<span class="tags-links in-content">', ', ', '</span>');
}
add_shortcode('tagsList', 'db_taglist');
This article explains adding PHP: https://docs.generatepress.com/article/adding-php/
2. Then add the [tagsList] shortcode to a HTML Widget in your sidebar.
Perfect. Thank you! How do I go about stylizing the tags?
Try something like this:
.sidebar .tag-links a {
color: #000;
font-size: 20px;
}
Adding CSS: https://docs.generatepress.com/article/adding-css/
Perfect. Thank you so much!
No problem :)