Viewing 4 replies - 1 through 4 (of 4 total)
  • Could you try rewording your question or elaborating? I’m not following you at this point. To directly answer without more understanding of your needs, you could always modify the global $query object and do the following:

    global $query;
    $query->is_page = true;

    But if you do it before The Loop, it’ll get reset anyway.

    Thread Starter ski3r

    (@ski3r)

    Thnx, I’ll try to explain a little bit better:

    1. I have an external page that calls get_header();
    2. the header.php has the following line:
    <div id=”container”<?php if (is_page() && !is_page(“archives”)) echo ” class=\”singlecol\””; ?>>

    I would like the container to have the class singlecol when I call it from the external page.

    You might try defining a constant within the external page *before* calling get_header(), let’s say:

    <?php define('is_external', 1); ?>

    Then change the if statement in header.php to:

    <?php if ((is_page() && !is_page("archives")) || (1 == is_external)) echo " class=\"singlecol\""; ?>

    Thread Starter ski3r

    (@ski3r)

    thnx Kafkaesqui!

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

The topic ‘is_page()’ is closed to new replies.