Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Category to Over ride other categories WordPress

Hello. I'm looking for a way to have 1 category override all other categories? Almost like an archive category. So all other categories would stay selected for a post in the back end, but once this special category is selected, all others won't be applied or visible for the front end except this special category. Thanks!

Answers (1)

2015-10-11

Sébastien | French WordpressDesigner answers:

in your template you can write :

if ( in_category( 'your_category' )) {
/* the temlate for this special category */
} else {
the template of category.php }


so if your special category is applied for this post, the template of this categroy is applied,
otherwise the basic template is applied