Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    This should do the trick:

    $paged = get_query_var('paged');
    if ($paged < 2) {
    // you're on page 1, put your code here
    }

    Thread Starter timwheatley

    (@timwheatley)

    Thanks!

    I tried to put it into single.php but the panorama shows on all pages. Here’s my code:
    <?php
    $paged = get_query_var('paged');
    if ($paged < 2) { ?>

    <?php if ( get_post_meta($post->ID, 'panorama_url', true) ) { ?><center>
    <applet archive="https://timwheatley.org/global/ptviewer.jar" code=ptviewer.class width=508 height=300 alt="Please install the Java Virtual Machine plug-in from https://www.java.com."><param name=file value="<?php echo get_post_meta($post->ID, "panorama_url", $single = true); ?>"></applet></center><div id="footer"><center>Click on the image and move your mouse to look around.<?php if ( get_post_meta($post->ID, 'panorama_size', true) ) { ?> Size: <?php echo get_post_meta($post->ID, "panorama_size", $single = true); ?><?php } ?>
    You may also use the - and + keys to zoom in and out.</center></div>
    <?php } ?>

    <?php } ?>

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Try “page” instead of “paged”. See if that works.

    Could be a WordPress bug there. I’m investigating.

    Thread Starter timwheatley

    (@timwheatley)

    That works. ??

    Thread Starter timwheatley

    (@timwheatley)

    Ah, one thing. It replaces the whole body of the posts page 1, not just the section I put the code around?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    I have no idea there. Likely you put the brackets around the wrong piece of code. The code I gave you does nothing at all, replaces nothing at all.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Conditional for ‘if page 1 of post’?’ is closed to new replies.