[Resolved] Custom Taxonomy's Archive Not Respecting Blog Settings

Home Forums Support [Resolved] Custom Taxonomy's Archive Not Respecting Blog Settings

Home Forums Support Custom Taxonomy's Archive Not Respecting Blog Settings

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #468810
    Satori

    I’m using custom post types (for critics and reviews of movies); I had to create a custom taxonomy also for the CPT’s, it’s called “genero” and have the next elements: Horror, Suspenso, Sci-Fi, etc. I’ve noticed that the archive page for each category doesn’t respect the blog settings of the customizer.

    You can check on my page, in the main menu there are the links to default categories, and from the custom taxonomy the link is called “Suspenso”. You’ll see how suspenso isn’t sharing the layout from the other archives.

    #468876
    Leo
    Staff
    Customer Support

    Hi there,

    Which part of layout are you referring to?

    I see that they are all using 3 columns grid and can’t see any differences.

    #468969
    Satori

    Hi Leo! You can visit this link Custom Taxonomy Archive

    #469369
    Tom
    Lead Developer
    Lead Developer

    You can enable columns using a filter like this: https://docs.generatepress.com/article/using-columns-in-the-blog/#adding-columns-to-your-custom-post-type

    And I believe you would use this conditional: https://codex.wordpress.org/Function_Reference/is_tax

    Let me know 🙂

    #469770
    Satori

    Hi Tom. I applied the filter but honestly I don’t know if I wrote it correctly.

    My custom taxonomy is called “genero”. Inside that taxonomy there are categories: Horror, Suspenso, Ciencia Ficción, etc. Each of those categories should display an archive page, it’s exactly these ones I want them to respect the blog settings.

    This is the code I inserted in the functions.php file.

    add_filter( 'generate_blog_columns','tu_portfolio_columns' );
    function tu_portfolio_columns( $columns ) {
        if ( is_tax( 'genero' ) ) {
            return true;
        }
    
        return $columns;
    }
    #469805
    Tom
    Lead Developer
    Lead Developer

    I just edited your code so it should work now 🙂

    #470235
    Satori

    Thank you Tom! It worked perfectly.

    #470374
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

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