Archived topic
Custom Taxonomy's Archive Not Respecting Blog Settings
7 replies · Started by Satori on January 11, 2018
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.
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.
Hi Leo! You can visit this link Custom Taxonomy Archive
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 :)
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;
}
I just edited your code so it should work now :)
Thank you Tom! It worked perfectly.
You're welcome :)