• Soccerwidow

    (@soccerwidow)


    I wrote following code in order to insert adverts on specific pages:

    <?php
    $paged = (get_query_var('page')) ? get_query_var('page') : 1;
    if (is_single( array( XX )) && 2 == $paged ) {
    	echo CODE;
    }
    elseif (is_single( array( XX )) && 4 == $paged ) {
    	echo CODE;
    }
    elseif (is_single( array( XX )) && 6 == $paged ) {
    	echo CODE;
    }
    else {
    	echo "";
    }
    ?>

    The code works perfect up to page number 5, but then it stops working.

    Also tried $paged > 5, but this doesn’t help either.

    Any ideas what may be wrong?
    Thanks for all your help!

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

    (@soccerwidow)

    I worked it out 🙂

    It was the Adinjection plugin interfering. I disabled the plugin, and the code is working perfect.

Viewing 1 replies (of 1 total)
  • The topic ‘Pagination $paged query /code addresing specific page number’ is closed to new replies.