Site logo

Archived topic

3 column category and tag pages and 2 column homepage

3 replies · Started by Jee on June 18, 2020

Viewing posts 1–4 of 4

Hi,

How can I set the homepage to just 2 columns but set category and tag pages to show 3 columns with smaller H2 font size?

Thanks!

Hi there,

you can use the generate_blog_get_column_count filter to conditionally set column widths:

https://docs.generatepress.com/article/using-columns-in-the-blog/#changing-the-number-of-columns

So you're PHP Snippet would look like this:

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;
}

For the font size you can use this CSS:

.category h2.entry-title,
.tag h2.entry-title {
    font-size: 20px;
}

Thank you!! It worked perfectly!

You're welcome

This archived topic is closed to new replies.