Site logo

Archived topic

Custom taxonomies

9 replies · Started by Matteo on May 8, 2020

Viewing posts 1–10 of 10

Hello,

I'd like to display the custom taxonomy archives in two columns instead of one.
Eg.:

https://china-underground.com/wp/collection/johnnie-to/

I'd like to display the filmography of each director with a two column layout, instead having just one column.
How can I do this?

Thanks again for your amazing template

Hi,

thanks! Do I need to add it via php snippet?

Best

Hello,

thanks again. In this case should I use this code in a snippet?

add_filter( 'generate_blog_get_column_count','tu_search_column_count' );
function tu_search_column_count( $count ) {
if ( is_tax() ) {
return 50;
}

return $count;
}

Thanks

Do I need to change the tu_search_column_count to something else?

Thanks

Is this correct?

That code is correct. You do not need to change tu_search_column_count but you can do to make it more meaningful eg.

matteo_tax_column_count

Make sure to change it in both places :)

Hi there,

Try this:

add_filter( 'generate_blog_columns', function( $columns ) {
    if ( is_tax() ) {
        return true;
    }

    return $columns;
} );

add_filter( 'generate_blog_get_column_count', function( $count ) {
    if ( is_tax() ) {
        return '50';
    }

    return $count;
} );

Glad we could help :)

This archived topic is closed to new replies.