Site logo

Archived topic

Columns for Categories

5 replies · Started by Math on June 15, 2021

Viewing posts 1–6 of 6

Hi,

I would like to maintain a single column look for the archive page as it is now (https://doodle.house/journal). But I would like to make the categories to be 2 columns (https://doodle.house/category/merch-styling).

I tried adjusting the columns in the layout option but it seems to be impacting both Archive and Categories. Is there a way around it?

Thank you.

Hi,

I tried placing the following snippet into functions.php, but doesn't seem to be working.

add_filter( 'generate_blog_get_column_count','db_tax_archive_column_count' );
function db_tax_archive_column_count( $count ) {
    if ( is_category() ) {
        return 33;
    }

    return $count;
}

I used the following and it worked! Thank you.

add_filter( 'generate_blog_columns','db_tax_archive_column_count' );
function tu_portfolio_columns( $columns ) {
    if ( is_category() || is_tag() ) {
        return true;
    }

    return $columns;
}

add_filter( 'generate_blog_get_column_count','db_tax_archive_column_count' );
function db_tax_archive_column_count( $count ) {
    if ( is_category() || is_tag() ) {
        return 33;
    }

    return $count;
}

No problem :)

This archived topic is closed to new replies.