Support » Fixing WordPress » <!–netxpage–> and conditional tags

  • Hi,
    i’m triyng to build a dynamic sidebar using conditional tags:
    <?php if(is_page('24')): ?> /* i'm on the page with ID 24, then print something */
    but if my post is splitted with <!–nextpage–> in the second page i want print out something else. I don’t know how check this. I’ve tried with;
    <?php if(is_page('24') && $page=2) : ?>
    but don’t works for me.

    Any ideas?

Viewing 9 replies - 1 through 9 (of 9 total)
  • You need to use this code. 😉

    <?php if(is_page('24') && $_GET['page'] == 2) : ?>

    Hi Viper,
    your code don’t works…
    Currently mod_rewrite is on and permalinks appears like this:

    Yes, but mod_rewrites it to an index.php based URL behind the scenes. 😉

    However, in the case of post/page permalinks, the whole string is given to WordPress to handle, so yeah, $_GET doesn’t work with permalinks.

    Hmm. Try $paged for the hell of it.

    If that doesn’t work, it may be time to rip apart the core files to see if a variable is set because I don’t know of any conditional tags that can handle this.

    $paged doesn’t work..

    It is possible that there is no tags to check if the post is splitted?

    There are no conditional for that that I see:

    But there’s gonna be a var…

    The var page=2 is useful but unusable with mod_rewrite on and permalinks…
    At this point i don’t know what i have to do…

    Actually, I believe it still gets set behind the scenes, but only when doing like category/page/2, not post/Page pages.

    Sounds like it’s time to rip apart the core files.

    $_GET[‘paged’] .. Fin.

    Ha, almost had it! lol

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘<!–netxpage–> and conditional tags’ is closed to new replies.