Support » Plugin: WP Geo » pages with multiple posts stopped working if paged?

  • Hi, somewhere along the way, an update to WordPress broke the following code that was working flawlessly for a long time:

    <?php $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
    $custom_query = array(
    'posts_per_page'	=> 10,
    'paged'	 => $paged
    );
    $newquery = array_merge( $wp_query->query, $custom_query );
    
    wpgeo_map( $newquery ); ?>

    Now, although the first page of 10 blog posts will show a map with the first 10 markers, every subsequent page also shows the first 10. I know that my query var for paged is correct, because when I echo it, it shows the correct page number. But the wpgeo_map is always showing the first page, no matter what. Any ideas how to fix this? Thanks!

    https://wordpress.org/plugins/wp-geo/

Viewing 2 replies - 1 through 2 (of 2 total)
  • anyone?

    nevermind, I figured this out myself. Here is new code which works. Hopefully it will help someone else out:

    $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
      $offsetnum = (($paged*10)-10);
      wpgeo_map( array(
        'offset' => $offsetnum,
        'posts_per_page' =>10
    ) );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘pages with multiple posts stopped working if paged?’ is closed to new replies.