[Support request] Query loop arguments – reusable block

Home Forums Support [Support request] Query loop arguments – reusable block

Home Forums Support Query loop arguments – reusable block

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #2343393
    Henrik

    Hi,

    first of all congrats to your superb system. I really enjoy using GB and GP. Unfortunately actually I’m facing a problem:

    – I have Custom Post Type with title, image and text as well as ACF fields.
    – In static articles I would like to show teasers (title, image, excerpt, acf field information) of some of the CPT posts.
    – I created a reusable block with a query loop but in the query for the CPT (also normal posts) I can only select a “search” argument
    – How can I query other fields like ID, acf values, taxonomies, terms??
    – As a workaround I used the search argument to only select one post and added a second reusable block on the same page but unfortunately this doesn’t work either, because both blocks are processing the same query and showing the same result. Changing the search query in one block does directly change the query in the other block.

    – How can I achieve to show 3 specific CPT posts with a reusable block ? Is query loop the right way? I also tried dynamic data but this has led to set the search query in the article for each item like (title, image…). That doesn’t make sense for me.

    I would be very pleased about a hint for a solution!!

    #2343434
    Fernando
    Customer Support

    Hi Henrik,

    Where are you adding the Query Loop Block in the articles? Are you trying to display the same 3 specific CPT posts in the articles you have in the same position? Have you tried using a Block Element instead of using a Reusable Block?

    As for Querying custom field, you can use a Headline Block for instance to query post meta data such as ACF custom Text fields. The same goes for images. You can use a GB Image Block.

    #2343747
    Henrik

    Hi Fernando,

    Thanks for your fast reply.

    I have the general Query Loop Block in the Reusable Block and am using this block in an article. There I try to set the specfic search: e.g. Article abour red shoes -> Insert Block and search for CPT posts with term red shoes and display the first 3 posts.

    No, I didn’t try a Block Element because I will add this block in several pages and it always has to look the same. So in this setup I will have to change it in 100 places when changing layout.

    Yes, I found that query for custom fields but in that case as mentioned in my question I will always have to set the query for each item as title, image, etc. there is no option for a global query for that block. Or am I missing something?

    #2344001
    David
    Staff
    Customer Support

    Hi there,

    You would need your Query to be created using the Current Post data, which is a GB Pro feature – see here:

    https://generateblocks.com/creating-related-posts-with-query-loop-block/

    #2344442
    Henrik

    Hi David,

    sorry, I forgot to mention. I work with GP Premium 2.1.2 and GB Pro 1.3.0.

    I would love to achieve the solution shown in the post but can’t make it.

    The only options shown when clicking on “Add Parameter” are:

    – Select query parameter
    — Page
    — Offset
    — Search

    Author, Order by, Taxonomies is not showing up. What am I doing wrong?

    #2344460
    Fernando
    Customer Support

    Hi Henrik,

    Can you share temporary admin credentials? We’ll check from our end what’s occurring? May you also provide the link where you’re adding the Query Loop.

    Please use the Private Information field for this: https://docs.generatepress.com/?s=private+information

    #2344478
    Henrik

    Sure.

    #2344483
    Fernando
    Customer Support

    You’re currently editing the page you link, so we can’t view it. Let us know once you’re finished, and we’ll check again.

    #2344485
    Henrik

    Sorry for that. Just had the tab open. Closed it now.

    #2344489
    Fernando
    Customer Support

    I see.

    I tried adding a Parameter to your Query Loop, and I can see the other stuff. Can you try clearing your browser’s cache or try using a different browser?

    #2344578
    Henrik

    Hi Fernando,

    Thank you so much for your increadible support. The browser cache did the trick.

    Very glad to be able to use this fantastic feature now!

    #2346900
    Fernando
    Customer Support

    You’re welcome Henrik! Glad it’s working now!

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