[Resolved] filter Category for query loop

Home Forums Support [Resolved] filter Category for query loop

Home Forums Support filter Category for query loop

Viewing 15 posts - 1 through 15 (of 53 total)
  • Author
    Posts
  • #2516902
    Jusung

    Hello!

    When you see this page on the link,
    you can see 5 buttons, which are All, SEO, Anaysis, Ads, Globalization.
    It indicates category.

    So, when the button is clicked, I only wanna show the posts that in the category that is clicked.

    I can think that I make 5 same pages, but shows posts in different categories.
    Is this only way to make this or is there a way to make this in one page?

    Thank you always!

    #2517250
    David
    Staff
    Customer Support

    Hi there,

    i would have each of those buttons link to your post category archive.
    And then use a Block Element – Loop Template for your Query Loop block:

    https://docs.generatepress.com/article/block-element-loop-template/

    #2517896
    Jusung

    It is complicated.
    When I make Loop Template, I can’t set hook-after header, which means the merged header is gone..

    Also, since the button is 5, am I supposed to make 5 block elements?

    #2517913
    Fernando
    Customer Support

    Hi Jusung,

    What David suggests is to display the Block Element you have for the Buttons on archive pages, and link each button to the default created archive pages.

    Then, for the archive pages, use a Block Element – Loop Template to style the posts.

    Make sure to enable “Inherit Query from Template” option in the Loop Template.

    #2518108
    Jusung

    Sorry. I don’t understand…

    I have made a page(portfoilo). You are saying I have to make (location: All archives) not page:portfolio?
    and links all the bettons to the the page(location: All archives)?

    and I have to make a block (loop template)

    I really don’t understand how this works..

    #2518133
    Fernando
    Customer Support

    It’s actually just a suggestion. What you had in mind is alright as well.

    What we were referring to is using the default archive pages instead of creating new pages.

    Can you provide admin login credentials so we can take a closer look at your setup?

    Please use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information

    #2518137
    Jusung

    I just created a new user to edit.

    I want to follow your suggestion since my way doesn’t look good.

    #2518179
    Fernando
    Customer Support

    Can you change the user to an admin?

    #2518185
    Jusung

    Just changed it to admin.

    #2518206
    Fernando
    Customer Support

    1. Create a new Block Element – Hook but only keep this Container and its content: https://share.getcloudapp.com/eDunDKAl

    2. Set the Block Element “Portfolio Page” to only appear on the Portfolio page.

    3. Create a Block Element – Loop template. Assign it to display on the 5 category archive pages. Add a Query Loop. Make sure to enable “Inherit Query from Template” option in the Loop Template settings.

    This should fix your structure.

    #2518448
    Jusung

    I have done what you said, but it doesn’t work.
    I don’t understand how the archive can be shown up on the portfolio page..

    I also added the link on the button, but when I click it, it directs me to blog..

    #2518708
    David
    Staff
    Customer Support

    Each link has to point to the relevant archive page

    eg.

    https://your_domainname/category/all/po-analysis/

    #2519198
    Jusung

    Yes. I have given the right link to each button.

    but when I click it, it directs me to the blog page, not portfolio..

    I think I need to change the location setting on blog and portfolio content.

    #2519212
    Fernando
    Customer Support

    Yes, that’s the correct setup.

    You just need to replace the display rule location of the Portfolio Head Element as such: https://share.getcloudapp.com/Z4um8LWp

    Add the other category archive pages as well to the display rule location.

    #2519231
    Jusung

    I changed it as you said.

    However, I can see the right sidebar that I want to remove.
    Also, I can’t see the merged head…

    On my blog,
    Blog
    Search Results
    Post Category: Content Marketing [SEO]
    Post Category: Performance Marketing
    Post Category: Advertising Strategy
    Post Category: International Marketing

    On the portfolio head
    Post Category: All
    Post Category: po-SEO
    Post Category: po-Analysis
    Post Category: po-Ads
    Post Category: po-Globalization

    On the portfolio content
    All Archives

    These are what is set..

    I think this is really complicated to me cuz there is no sidebar on portfolio and there is a sidebar on blog..

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