• Resolved boyettcamp

    (@boyettcamp)


    I used code on a previous thread here to display CPT as GRID (not list).

    However, sub cats still display as a LIST. e,g,

    CPT – GUIDES = GRID (displays as Grid – great!)
    CPT – GUIDES – MONEY = LIST

    Can I get CPT sub-categories to also display as GRID too?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter boyettcamp

    (@boyettcamp)

    This was the previous recommended Code I used (as per thread on this forum):

    function my_custom_body_class( $classes ) {
    	if ( is_post_type_archive() ) {
    		$blog_layout = get_theme_mod( 'twentig_blog_layout' );
    		$classes[] = 'tw-blog-' . $blog_layout;
    
    		if ( 'grid-basic' === $blog_layout || 'grid-card' === $blog_layout ) {
    			$classes[] = 'tw-blog-grid';
    			$classes[] = 'tw-blog-columns-' . get_theme_mod( 'twentig_blog_columns', '3' );
    			add_filter(
    				'post_thumbnail_size',
    				function() {
    					return 'large';
    				}
    			);			
    		}
    	} 
    	return $classes;
    }
    add_filter( 'body_class', 'my_custom_body_class', 12 );
    Plugin Author Twentig

    (@twentig)

    Hi,

    If you wish that all your archive pages display as a grid, you can try to replace if ( is_post_type_archive() ) { by if ( is_archive() ) {

    Hope that helps,
    Tom

    Thread Starter boyettcamp

    (@boyettcamp)

    Thanks Tom. Perfect. That worked ??

    Thread Starter boyettcamp

    (@boyettcamp)

    10/10 ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Archive – CPT – Sub Categories – Grid’ is closed to new replies.