• Resolved barmin

    (@barmin)


    I’m using the following script to customize the content of the sidebar:

    <?php if ( in_category(4) ) {

    // some php includes

    } else {

    //some else php includes

    }
    ?>

    The thing is, when I come to a PAGE, the script prints the output for ‘if ( in_category(4) )’, showing the exclusive content.

    Why does this happen? How do I fix it? Since pages have no categories, it should print the ELSE’s output.

    For a second category exclusive content, should I just replace the ELSE for an ELSEIF, like this?

    <?php if ( in_category(4) ) {

    // some php includes for cat. 4

    } elseif ( in_category(2) ) {

    //some else php includes for tat. 2

    }
    ?>

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Pages are being categorized!’ is closed to new replies.