[Resolved] Blog post tags-links in sidebar widgets

Home Forums Support [Resolved] Blog post tags-links in sidebar widgets

Home Forums Support Blog post tags-links in sidebar widgets

  • This topic has 5 replies, 3 voices, and was last updated 3 years ago by Leo.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1726130
    Megan

    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!

    #1726467
    David
    Staff
    Customer Support

    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.

    #1731595
    Megan

    Perfect. Thank you! How do I go about stylizing the tags?

    #1731635
    Leo
    Staff
    Customer Support

    Try something like this:

    .sidebar .tag-links a {
        color: #000;
        font-size: 20px;
    }

    Adding CSS: https://docs.generatepress.com/article/adding-css/

    #1732334
    Megan

    Perfect. Thank you so much!

    #1732787
    Leo
    Staff
    Customer Support

    No problem 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.