[Resolved] Change category and tags links display

Home Forums Support [Resolved] Change category and tags links display

Home Forums Support Change category and tags links display

  • This topic has 13 replies, 3 voices, and was last updated 4 years ago by Leo.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1246814
    Ricardo

    Hi,

    Could you please give me any hint on how to change the way categories and tags links are displayed?

    I don’t know the exact terms, so I will give you a picture of what I would like to have:

    example

    https://www.poetryfoundation.org/poems/browse#page=1&sort_by=recently_added&filter_poetry_children=1

    So basically I would like to remove commas and create a background color to each of the category and tag.

    Thanks in advance,
    Ricardo

    #1247070
    Leo
    Staff
    Customer Support

    Hi there,

    Try this snippet to remove the comma first:

    add_filter( 'generate_term_separator', function() {
        return '';
    } );

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    Then link me to the page in question and I’ll provide some CSS.

    Let me know 🙂

    #1247118
    Ricardo

    Hi,

    Thanks a lot, it’s very nice from your side to give this level of support.

    This tags and categories appear in all search result, in all blog post and in all categories and tags page

    Cateory page:
    https://anexim.pt/category/proverbios-da-regiao-de-valpacos/

    Post:
    https://anexim.pt/mulher-sem-vergonha-pior-que-peconha/

    King regards,
    Ricardo

    #1247236
    Leo
    Staff
    Customer Support

    Are you using any custom functions or plugin to display the categories?

    The <ul class="post-categories"> isn’t the default structure.

    #1247555
    Ricardo

    Hi,

    I’m not sure what is the `<ul class=”post-categories”>, but I’ sure that the only thing that is affecting it is the snippet that you’ve indicated me to use:

    add_filter( ‘generate_term_separator’, function() {
    return ”;
    } );

    I’ll disable it, so that you can see if it is about it.

    Thanks,
    Ricardo

    #1248216
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Any chance you can re-add it so I can take a look?

    Let me know 🙂

    #1248241
    Ricardo

    Hi,

    Sure. It’s done.

    Thanks

    #1248274
    Leo
    Staff
    Customer Support

    Looks like we need a space in the return value.

    Try this instead:

    add_filter( 'generate_term_separator', function() {
        return ' ';
    } );
    #1248287
    Ricardo

    Nice!

    Now it looks better.

    #1248293
    Leo
    Staff
    Customer Support

    Now we just have to do something like this:

    .entry-meta a {
        padding: 3px 5px;
        background-color: #444444;
    }

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

    #1248311
    Ricardo

    Beautiful 🙂

    Is there anyway to make it different for categories and for tags. I mean, is it possible to distinguish between the two of them so that I can give different colors?

    Thanks!

    #1248440
    Leo
    Staff
    Customer Support

    Try this:

    .entry-meta .cat-links a {
        padding: 3px 5px;
        background-color: #2a2;
    }
    .entry-meta .tags-links a {
        padding: 3px 5px;
        background-color: #000;
    }
    #1248474
    Ricardo

    That is great Leo!

    Thank you so much for your support on this topic.

    If you and Tom need anything about guitar, Fado or music I’ll be glad to help you.

    Best regards,
    Ricardo

    #1248485
    Leo
    Staff
    Customer Support

    Glad we could help 🙂

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