Viewing 1 replies (of 1 total)
  • Thread Starter alex20hz

    (@alex20hz)

    Tested this code:

    <?php
    // let’s generate info appropriate to the page being displayed
    if (is_home()) {
    // we’re on the home page, so let’s show a list of all top-level categories
    echo “home”;
    } elseif (is_category(‘Beauty & Health’)) {
    // we’re looking at a single category view, so let’s show _all_ the categories
    echo “beauty-health”;
    } elseif (is_single()) {
    echo “single”;
    } elseif (is_page()) {
    // we’re looking at a static page. Which one?
    if (is_page(‘Archives’)) {
    // our about page.
    echo “<p>This is my about page!</p>”;
    } elseif (is_page(‘Colophon’)) {
    echo “<p>This is my colophon page, running on WordPress ” . bloginfo(‘version’) . “</p>”;
    } else {
    // catch-all for other pages
    echo “check”;
    }
    } else {
    // catch-all for everything else (archives, searches, 404s, etc)
    echo “Error”;
    } // That’s all, folks!
    ?>

    AND when i try is_category(‘Beauty & Health’) it doesn’t work but with in_category(‘4’) it works fab. Why?

Viewing 1 replies (of 1 total)
  • The topic ‘Template pages issue’ is closed to new replies.