Number of Archive Pages is Wrong

Intro

You can change this by going to Appearance > Editor and click on archives.php (the plural one). At the top is this: global $wpquery; if (is_paged()) : $fetch_archive = query_posts(“posts_per_page=12&paged=”.get_query_var(‘paged’)); else : $fetch_archive = query_posts(“posts_per_page=12&paged=”); endif; Replace it with: global $wpquery; $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $args = array(‘paged’ => $paged ); $fetch_archive […]

Solution

You can change this by going to Appearance > Editor and click on archives.php (the plural one). At the top is this:

global $wpquery;
    if (is_paged()) :
        $fetch_archive = query_posts("posts_per_page=12&paged=".get_query_var('paged'));
    else :
        $fetch_archive = query_posts("posts_per_page=12&paged=");
    endif;

Replace it with:

  global $wpquery;
  $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  $args = array('paged' => $paged );
  $fetch_archive = query_posts($args);

 

Get 15% off!

Signup and get 15% off any of our Ghost or Framer themes immediately