[Resolved] Custom taxonomies

Home Forums Support [Resolved] Custom taxonomies

Home Forums Support Custom taxonomies

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1275779
    Matteo

    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

    #1276005
    Leo
    Staff
    Customer Support
    #1276589
    Matteo

    Hi,

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

    Best

    #1276681
    David
    Staff
    Customer Support

    Hi there,

    yes the add_filter code is a PHP Snippet … this article explains how to add:

    https://docs.generatepress.com/article/adding-php/

    #1277958
    Matteo

    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?

    #1277973
    David
    Staff
    Customer Support

    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 πŸ™‚

    #1278079
    Matteo

    Hello,

    thank you! I added and activated the snippet. However in the custom taxonomy archives I still see one column instead of two. What am I doing wrong?

    Eg;

    https://china-underground.com/wp/actor/andy-lau/
    https://china-underground.com/wp/collection/fruit-chan/

    Thanks again!

    #1278328
    Tom
    Lead Developer
    Lead Developer

    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;
    } );
    #1278338
    Matteo

    Hello,

    thank you so much! At the end I chose the 3 column layout, I think it’s great:

    https://china-underground.com/wp/actor/shu-qi/

    Thanks again for your amazing support

    #1278344
    Tom
    Lead Developer
    Lead Developer

    Glad we could help πŸ™‚

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.