- This topic has 11 replies, 3 voices, and was last updated 3 years, 3 months ago by
Fernando.
-
AuthorPosts
-
January 23, 2023 at 6:55 am #2505835
Benjamin
Hello,
I created a custom query loop for my posts using GP Blocks Pro, and GP Pro Elements and then set it to display on all archives.
I hoped it would replace the current archive layout, but it didn’t. (As in the category and tag page layout).
How can I achieve this? Do I need to disable elements somewhere? I looked but couldn’t find anything to disable.
(PS. I’m not really sure where to ask for support regarding GP Blocks Pro styling, etc., I see there is a support section on the site, but asked a few hours ago and haven’t gotten a reply, do I ask here or what?).
Thank you.
January 23, 2023 at 7:14 am #2505854David
StaffCustomer SupportHi there,
the Block Element you used, can you make sure it has the Element Type set to
Loop TemplateAnd in the Query Loop Parameters enabled the
Inherit Query from TemplateHere is fine to ask as it is theme related. And its not a problem asking GB support questions here either. If that helps
January 23, 2023 at 10:19 pm #2506693Benjamin
Hi David…
Thanks, that did something. Just not the right thing. XD.
I have the location set to all archives in the elements menu. When following your steps, it just removes all the posts from the archive page (in their normal form that they were in previously) and displays a blank page with just the header and footer… What am I missing here?
I tried removing the sidebar, thought that might have something to do with it, but didn’t work either.
Let me know.
Thanks.
January 23, 2023 at 10:37 pm #2506700Fernando Customer Support
Hi Benjamin,
So we can take a closer look at your setup, can you provide admin login credentials?
Please use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
January 23, 2023 at 10:53 pm #2506712Benjamin
I watched this video and was able to add a title, https://www.youtube.com/watch?v=L1KtrKJIFzk, messed around with the query loop a bit (really not sure what I changed, basically just switched the inherit query from template on and off).
Anyway, now it’s displaying posts. I want to know if is there a way to change the number of posts that are being displayed? If I turn the query loop off, you can change it, but if it’s on, I don’t see a clear way to change the number of posts on a page.
PS. How can I add pagination?
Thanks.
January 23, 2023 at 11:03 pm #2506717Fernando Customer Support
I see. You can change the Posts per page through Settings > Reading > Blog pages show at most.
For the GB Query Loop Block, you can add pagination through the toolbar. Example: https://share.getcloudapp.com/E0uZDO4E
January 24, 2023 at 12:00 am #2506747Benjamin
Thank you, everything is working now.
Last thing, I want to know, for the search results page, if I create a custom version for that, what dynamic data would I have to use on the headline block to get something similar to what GP does by standard?
E.g. If I search GP support in my search bar it will give back: Search Results For: GP Support, how can I achieve this?
Thank you!
January 24, 2023 at 12:08 am #2506751Fernando Customer Support
You’ll need a custom code for that.
Can you take a screenshot of the Dynamic settings of your Headline Block for the title?
January 24, 2023 at 12:14 am #2506755Benjamin
Screenshots links are attached in sensitive info section.
Thanks.
January 24, 2023 at 12:18 am #2506758Fernando Customer Support
Thank you.
Add
search-title-changeto the class list of that Headline Block.Adding Custom Classes: https://wordpress.com/support/wordpress-editor/adding-additional-css-classes-to-blocks/
Then, add this snippet:
add_filter( 'generate_dynamic_element_text', function( $text, $block ) { if ( !is_admin() && is_search() && ! empty( $block['attrs']['className'] ) && 'search-title-change' === $block['attrs']['className'] ) { $text = 'Search Results For: ' . get_search_query(); } return $text; }, 10, 2 );Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets
January 24, 2023 at 3:00 am #2506868Benjamin
Thank you! You’ve been of great help.
January 24, 2023 at 9:57 pm #2508066Fernando Customer Support
You’re welcome, Benjamin!
-
AuthorPosts
- You must be logged in to reply to this topic.