Site logo

Archived topic

Footer Hook problem on CPT archive

5 replies · Started by melvin on October 6, 2022

Viewing posts 1–6 of 6

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

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

Hi Fernando,

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

TQ

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

ok noted. thanks fernando

You're welcome Melvin!

This archived topic is closed to new replies.