- This topic has 46 replies, 3 voices, and was last updated 3 years, 8 months ago by
David.
-
AuthorPosts
-
September 7, 2022 at 12:54 am #2335623
David
StaffCustomer SupportHi Karen,
you can use a GenerateBlocks Query Loop see here:
https://www.screencast.com/t/RGk2FcPvLQ
Note the Order By > Random parameter is a GB Pro feature.
September 7, 2022 at 12:56 am #2335626Karen
Thanks. We have Pro.
But the video starts without saying what/where to create it. Are you creating it in Elements or where?Also, what’s next?
If you can add a step by step for creating the blue box (in Elements like we did?), pulling in the query, etc.
September 7, 2022 at 12:58 am #2335627David
StaffCustomer SupportAah – ok you can built it wherever you need it.
A Block Element – Hook would make sense, then you can hook it into your pages or posts.September 7, 2022 at 1:03 am #2335633Karen
Okay, then what’s next? How do we display the CPT (title and post) in the blue box? Do we create another element for the blue box like we did already or or global style or…?
September 7, 2022 at 1:18 am #2335644David
StaffCustomer SupportNo need for other containers.
In the Query Loop there is the Post Template container, select that and give it a background. See here:September 7, 2022 at 1:27 am #2335651Karen
OK, will try it. Thank you. This is all new to us. The block editor and GP.
September 7, 2022 at 1:28 am #2335656David
StaffCustomer SupportLet us know how you get on 🙂
September 7, 2022 at 1:31 am #2335658Karen
Will do! 👍
September 7, 2022 at 7:40 am #2335939Karen
Any idea why I’m getting “Order” drop down instead of “Order by” drop down?
https://www.dropbox.com/s/uhjvyaf1m0nupkx/query-order.jpg?dl=0Also, FYI, the title is on the bottom and actual text/content is on top.
September 7, 2022 at 7:46 am #2335949David
StaffCustomer SupportNote the Order By > Random parameter is a GB Pro feature.
Order is in free. Order By is only in GenerateBlocks Pro.
If you don’t have GB Pro then:1. Add this PHP Snippet to your site:
add_filter( 'generateblocks_query_loop_args', function( $query_args, $attributes ) { if ( ! empty( $attributes['className'] ) && strpos( $attributes['className'], 'orderby-rand' ) !== false ) { $query_args['orderby'] = 'rand'; } return $query_args; }, 10, 2 );2. Edit the Query Loop, select its Grid Block and in Advanced > Additional CSS Class(es) add:
orderby-randAnd that will set the WP Query
orderby=>randparameter.September 7, 2022 at 7:53 am #2336133Karen
Thanks! But we do have GP and GB pro. Happy to add more code but would like the cleaner drop down if possible?
September 7, 2022 at 7:57 am #2336135David
StaffCustomer SupportIf you have GB Pro then you should see
orderandorder byin the drop down.
Are both plugins, GB Free and GB Pro up to date ?September 7, 2022 at 8:01 am #2336145Karen
Weird. Yes. They’re both up to date. Should GB say Pro? In Plugins, GP says Pro but GB doesn’t say pro but I paid for both.
September 7, 2022 at 8:02 am #2336146Karen
Scratch that. GB says pro and GP says premium. So yes, I have paid both. Hmmm, what could it be? Do you want login again?
See my screenshot. I’m getting the Order drop down but not the Order by drop down.
September 7, 2022 at 8:05 am #2336151David
StaffCustomer SupportYeah – send us a login and ill take a look 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.