[Resolved] Different text in blue box for each page

Home Forums Support [Resolved] Different text in blue box for each page

Home Forums Support Different text in blue box for each page

Viewing 15 posts - 16 through 30 (of 47 total)
  • Author
    Posts
  • #2335623
    David
    Staff
    Customer Support

    Hi Karen,

    you can use a GenerateBlocks Query Loop see here:

    Note the Order By > Random parameter is a GB Pro feature.

    #2335626
    Karen

    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.

    #2335627
    David
    Staff
    Customer Support

    Aah – 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.

    #2335633
    Karen

    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…?

    #2335644
    David
    Staff
    Customer Support

    No need for other containers.
    In the Query Loop there is the Post Template container, select that and give it a background. See here:

    #2335651
    Karen

    OK, will try it. Thank you. This is all new to us. The block editor and GP.

    #2335656
    David
    Staff
    Customer Support

    Let us know how you get on πŸ™‚

    #2335658
    Karen

    Will do! πŸ‘

    #2335939
    Karen

    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=0

    Also, FYI, the title is on the bottom and actual text/content is on top.

    #2335949
    David
    Staff
    Customer Support

    Note 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-rand

    And that will set the WP Query orderby=>rand parameter.

    #2336133
    Karen

    Thanks! But we do have GP and GB pro. Happy to add more code but would like the cleaner drop down if possible?

    #2336135
    David
    Staff
    Customer Support

    If you have GB Pro then you should see order and order by in the drop down.
    Are both plugins, GB Free and GB Pro up to date ?

    #2336145
    Karen

    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.

    #2336146
    Karen

    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.

    #2336151
    David
    Staff
    Customer Support

    Yeah – send us a login and ill take a look πŸ™‚

Viewing 15 posts - 16 through 30 (of 47 total)
  • You must be logged in to reply to this topic.