[Resolved] Query loop block layout issue!

Home Forums Support [Resolved] Query loop block layout issue!

Home Forums Support Query loop block layout issue!

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2365801
    HJ

    Hi,

    I have a query loop block in my sidebar that appears as a 2-column layout on my homepage, category, tag pages, etc where it supposes to appear as a list. It does look fine though on my posts and pages.

    I need help figuring this out, please.

    Thank you.

    #2365826
    Fernando
    Customer Support

    Hi HJ,

    Try adding this Snippet:

    add_filter( 'post_class', function( $classes ) {
    	if ( is_archive() && in_array( 'gb-query-loop-item', $classes ) ) {
    		$index = array_search('generate-columns',$classes);
    if($index !== FALSE){
        unset($classes[$index]);
    }
    		
    	}
    
    	return $classes;
    } );

    Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets

    #2366165
    HJ

    Hi Fernando,

    Thanks for your response.

    I didn’t have that problem before I updated to the latest version of generateblock.

    Isn’t the Query loop block supposed to work out of the box? Do I need to add this code to make the Query loop block work as it should? What seems to be the issue?

    Thank you.

    #2366953
    David
    Staff
    Customer Support

    Hi there,

    we’re working on improving how the Query Loop grid operates, some of this requires changes that may have the odd conflict with the GP Blog columns.

    For now you can either:

    1. Use the snippet that Fernando provided.

    2. Select the Post Template block in the Query Loop grid, and set its Flex Basis to 100%

    #2367285
    HJ

    Hi David,

    No luck here. I tried both methods and none of them fixed the layout issue. I cleared the cache and used another browser, but it is still displaying in 2 columns.

    #2367589
    David
    Staff
    Customer Support

    I am not seeing the flex basis property. Can you check this specific setting:

    2022-10-09_12-18-46

    #2370597
    HJ

    Thanks, David. The issue has been resolved. You can close this ticket.

    #2370876
    David
    Staff
    Customer Support

    Glad to hear thats working!

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