[Resolved] Footer Hook problem on CPT archive

Home Forums Support [Resolved] Footer Hook problem on CPT archive

Home Forums Support Footer Hook problem on CPT archive

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2365758
    melvin wang

    Hi,

    I’ve a footer hook block in my entire site https://imgur.com/a/JdmbAXT , things look good except on my CPT archive desktop https://imgur.com/a/eXGJS4a .

    Things i’ve done : regenerate external CSS but still the same, any idea on how to solve it?

    TQ

    #2365807
    Fernando
    Customer Support

    Hi Melvin,

    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

    #2365823
    melvin wang

    Hi Fernando,

    Thanks it fixed the issue. May I know whats the code about and why it will fix ya?

    TQ

    #2365832
    Fernando
    Customer Support

    It removes the class generate-columns from Query loops which sets columns for loops in archive pages in general.

    #2365889
    melvin wang

    ok noted. thanks fernando

    #2365918
    Fernando
    Customer Support

    You’re welcome Melvin!

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