Site logo

[Resolved] Query Loop – No Results Found

Home Forums Support [Resolved] Query Loop – No Results Found

Home Forums Support Query Loop – No Results Found

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2523566
    Zoltan

    Hi, I’m following a custom archive template tutorial. I can’t figure out why my query loop is bringing in “No Results Found.”

    I am using CPT UI and created a custom post called Services. Show in Rest API: True, Has Archive: True. The Services Archive page has 4 posts visible.

    Then I created a block element named Archive, type: Loop Template, location: Services Archive.

    Then when I add in a GB Query Loop element, it returns “No Results Found” instead of an editable block.

    I tried the Query Loop on the WordPress blog posts archive and it worked. It just doesn’t work on my Custom Post archive.

    I am new to CPT UI and GeneratePress. Any help would be appreciated. Thanks

    #2523607
    Ying
    Staff
    Customer Support

    Hi Zoltan,

    Is there anything showing on the services archive front end?
    Can you link us to the services archive for us to take a look?

    #2523621
    Zoltan

    When I set the Location of the block, the Services Archive front end loses its 4 posts.

    #2523638
    Ying
    Staff
    Customer Support

    Is the element called archive? If so, you’ve chosen the post post type not the services post type for the query loop:
    https://www.screencast.com/t/jNaz5jZVCu

    #2523681
    Zoltan

    Thanks! It works now.

    I think my problem was being caused by turning on “Inherit Query From Template.” When I toggled that on, the post type selector disappeared, and I wasn’t able to choose the correct post type.

    If I leave the “Inherit Query…” off, then I can select services post type like you suggested.

    Anyways, thanks again for the help, I appreciate it 🙂

    #2523702
    Ying
    Staff
    Customer Support

    When the inherit query from template option is enabled, it uses the post post type, as you don’t have any published posts, so it returns no posts found 🙂

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