0

I want to make two single.php, The first single.php display all categories content but not display two categories, and I want to make a different single.php for that two categories, I hope to help me.

1

you can use:

 if ( in_category('cat1') || in_category('cat2')) {
        include 'single-cattwo.php'; //for the 2 categories
    } else {
        // Default
        include 'single-allcat.php';//all categories
    }

inside single.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.