Query block questions/guidance

  • ascofield1107

    I’m trying to build a custom grid of CPT posts and have some questions and concerns. It’s the the cat grid on this page: https://96y.067.myftpupload.com

    • Order and orderby not working
    • Image markup for post meta after_image field wonky.
    • I initially created this as a “Query Loop” block instead of a “Query” (named Meet Our Cats which is currently hidden)
    • What is the difference between these block types?
    • Depending on page, I’d like to filter results by “cat status” and possibly by custom order of the cats (with “sticky” cats using the Post Types Order plugin for this), date posted, post title, etc.
    • Filtering is not working on the custom taxonomy Cat Status (cat_status). I then tried to use a custom taxonomy for cat status because I figured it would be easier/cleaner to filter without adding php.
    • Cat status is not being filtered – should show adopted/available or all cats. I then tried to use a custom taxonomy for the cat status. This mostly works. For some reason, the cat status term for https://96y.067.myftpupload.com/cats/dahlia/ is not saving when editing a post.

    Hope that makes sense!

  • Hi there,

    1. Your image field’s Return format in ACF is set to Image ID, so the image block is actually pulling the ID, not the URL. Try setting it to the image URL instead.

    2. Query is the name of V2 block, Query loop is the name of the v1 block. The query loop block has been deprecated. I would recommend using the Query block.

    3. I am not sure if GB supports the sticky status created by a 3rd party plugin.

    4. cat_status is a custom taxonomy. If you only want to show cats with a certain term, you can select the query block, click the add parameter button, add taxonomy > cat status, and include the term.

    Note: I don’t know if it’s intended, but you currently set the query to exclude the adopted term.

    5. If you add multiple filters to the query, they will be using AND logic, so only posts that match all filters will show.

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