HI,
in my child theme’s single.php I have modified this code:
get_template_part( 'includes/loop', 'index' );
to:
if(in_category('current-developments')) {
get_template_part( 'includes/loop', 'index' );
}
else {
get_template_part( 'includes/loop', 'sub-index' );
}
This is working fine, I am able to customise the loop for those in the category ‘current-developments’. My issue is I cant figure out how to add multiple categories here, I tried:
if(in_category('current-developments','other-category')) {
get_template_part( 'includes/loop', 'index' );
}
else {
get_template_part( 'includes/loop', 'sub-index' );
}
but this didnt work.
Any help would be great!
thanks
Hey dannhanks,
You need to pass an array as parameter:
if(in_category(array('current-developments','other-category'))) {
Best regards,
Josue