Site logo

[Support request] Customizing the blog, does not apply the design of the first post.

Home Forums Support [Support request] Customizing the blog, does not apply the design of the first post.

Home Forums Support Customizing the blog, does not apply the design of the first post.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2548607
    Carlos

    Hello, I have made a content template block to customize the blog, when indicating infinite scrolling in the wordpress customizer, the posts are loaded when I scroll down but the design of the first ones is not applied. How can I make all posts have the same design?

    #2548910
    David
    Staff
    Customer Support

    Hi there,

    try adding this PHP Snippet, so the Query Loop Block is ignored in the infinite scroll:

    
    add_filter( 'post_class', function( $classes ) {
    	$infinite_scroll_item_index = array_search( 'infinite-scroll-item', $classes );
    
    	if ( in_array( 'gb-query-loop-item', $classes ) && $infinite_scroll_item_index !== false ) {
    		unset( $classes[ $infinite_scroll_item_index ] );
    	}
    
    	return $classes;
    } );
    #2548985
    Carlos

    Excuse me and thanks for your answer, where do I have to add the PHP code snippet?

    #2549132
    Ying
    Staff
    Customer Support

    Hi Carlos,

    You can use one of the methods introduced here to add PHP code:
    https://docs.generatepress.com/article/adding-php/

    #2549638
    Carlos

    Thank you very much for the solution,
    I have incorporated the code in the child theme’s functions.php file and it has worked perfectly.

    #2549957
    David
    Staff
    Customer Support

    Glad to hear that worked

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