- This topic has 11 replies, 3 voices, and was last updated 6 months, 1 week ago by Fernando.
September 14, 2022 at 11:55 pm #2343393Henrik
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!!September 15, 2022 at 1:05 am #2343434Fernando Customer Support
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.September 15, 2022 at 7:39 am #2343747Henrik
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?September 15, 2022 at 9:05 am #2344001DavidStaffCustomer Support
You would need your Query to be created using the
Current Postdata, which is a GB Pro feature – see here:
Adding CSS: http://docs.generatepress.com/article/adding-css/September 15, 2022 at 11:25 pm #2344442Henrik
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
Author, Order by, Taxonomies is not showing up. What am I doing wrong?September 15, 2022 at 11:59 pm #2344460Fernando Customer Support
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+informationSeptember 16, 2022 at 12:31 am #2344478Henrik
Sure.September 16, 2022 at 12:37 am #2344483Fernando 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.September 16, 2022 at 12:38 am #2344485Henrik
Sorry for that. Just had the tab open. Closed it now.September 16, 2022 at 12:41 am #2344489Fernando Customer Support
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?September 16, 2022 at 2:46 am #2344578Henrik
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!September 18, 2022 at 5:10 pm #2346900Fernando Customer Support
You’re welcome Henrik! Glad it’s working now!
- You must be logged in to reply to this topic.