Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Add loop to Category page based on taxonomy

  • Hello support-team,

    How can I add a loop for all category pages based on taxonomy and keywords.

    The loop should filter on fixed keywords e.g. top-1, top-2 and top-3 and also take into account the internal category of the category page e.g. “Berlin”.

    Is this easy to solve with standard functionality in GeneratePress?

    Kind regards
    Jens

  • Hi there,

    I don’t think keywords would work in this case, you might need to create tags like top-posts, and assign the posts to that tag.

    Then you can set the query loop to taxonomy > category > current category, and add taxonomy > tag > top-posts.

    However, please note that the current category option is a GB Pro option.

  • Hi Ying,

    then I’ll try using post tags.
    But how do I get an additional loop on all category pages with my top-1 to top-3 tags

    The goal is to add a separate loop to all category pages, e.g.:
    https://www.museum-ticket.info/de/standorte/deutschland/museen-potsdam/

    In addition to the standard loop, which also takes the tags into account.

    Do I have to extend this in the archive.php or use a hook?
    Do you have an example for me?

    Kind regards
    Jens

  • Hi there,

    Can you provide more context on how this additional query loop is expected to function? Does it act as a filtering mechanism, where selecting a top tag dynamically queries and loads the related posts for that taxonomy term, with the same behavior applied to other tags?

  • Hi Alvind,

    I’m happy to add my information. 🙂
    The goal is to structure all category pages uniformly.

    – H1 headline
    – Feature image
    – Custom content via custom field on the category
    – Custom loop (top list) with internal taxonomy + tags (Top1, Top2, Top3)
    – Standard category loop with internal taxonomy

    The custom loop that I would like to add to the category page. So I would have to use the taxonomy of the internal category and also filter on my tags (Top1, Top2, Top3).

    Is that easy to do?

    At the moment I find it very difficult to adapt the category page.

  • So generally, you will create a block element – loop template to add all this content and assign it to category archives.

    As for the 2 loops, what do you mean by internal taxonomy? Do you mean the child categories of the current category?

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