Pagination does not work for latest posts

Best WordPress theme for festivals or other events with responsive, clean and unique design.
GK User
Thu May 09, 2013 3:44 am
Pagination does not work for latest posts

You can see that in your own demo site.

http://demo.gavick.com/wordpress/fest/?page_id=895

Click older posts, you get always the same results.

I'm tired of finding bugs in this theme.
And you don't answer quick enough.

This is a beta theme, lots of bugs.

I'm really not happy.
User avatar
Expert Boarder

GK User
Thu May 09, 2013 6:25 am
I have reported this bug to our dev team.
User avatar
Moderator

GK User
Thu May 09, 2013 7:10 am
The problem will be fixed in the nearest release of the template.

Solution is changing in the template.latest.php line:

Code: Select all
$paged = isset($_GET['paged']) ? (is_numeric($_GET['paged']) ? $_GET['paged'] : 1) : $paged;

to:

// get the page number
Code: Select all
$paged = (get_query_var('paged')) ? get_query_var('paged') : ((get_query_var('page')) ? get_query_var('page') : 1);
User avatar
Moderator

GK User
Thu May 09, 2013 7:45 am
I cannot find that piece of code in template.latest.php

Are you sure this is the right file i have to look into ?



This is the entire content of template.latest.php


Code: Select all
<?php
/*
Template Name: Latest Posts
*/

global $tpl;

gk_load('header');
gk_load('before');

query_posts('posts_per_page=' . get_option('posts_per_page'));

?>

<?php if ( have_posts() ) : ?>
   <section id="gk-mainbody">
      <?php gk_content_nav(); ?>
      
      <?php while ( have_posts() ) : the_post(); ?>
         <?php get_template_part( 'content', get_post_format() ); ?>
      <?php endwhile; ?>
      
      <?php gk_content_nav(); ?>
      
      <?php wp_reset_query(); ?>
   </section>
<?php else : ?>
   <section id="gk-mainbody">
      <article id="post-0" class="post no-results not-found">
         <header class="entry-header">
            <h1 class="entry-title"><?php _e( 'Nothing Found', GKTPLNAME ); ?></h1>
         </header>

         <div class="entry-content">
            <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', GKTPLNAME ); ?></p>
            <?php get_search_form(); ?>
         </div>
      </article>
   </section>
<?php endif; ?>

<?php

gk_load('after');
gk_load('footer');

// EOF
User avatar
Expert Boarder

GK User
Thu May 09, 2013 8:09 am
I don't see that piece of code in the file you mentionned (template.latest.php)
User avatar
Expert Boarder

GK User
Thu May 09, 2013 8:27 am
Yes, that is a correct file.
Without patch it looks like this:
Code: Select all
<?php
/*
Template Name: Latest Posts
*/

global $tpl;

gk_load('header');
gk_load('before');

global $more;
$more = 0;

$paged = isset($_GET['paged']) ? (is_numeric($_GET['paged']) ? $_GET['paged'] : 1) : $paged;

query_posts('posts_per_page=' . get_option('posts_per_page') . '&paged=' . $paged );

?>

<?php if ( have_posts() ) : ?>
   <section id="gk-mainbody">
      <?php gk_content_nav(); ?>
      
      <?php while ( have_posts() ) : the_post(); ?>
         <?php get_template_part( 'content', get_post_format() ); ?>
      <?php endwhile; ?>
      
      <?php gk_content_nav(); ?>
      
      <?php wp_reset_query(); ?>
   </section>
<?php else : ?>
   <section id="gk-mainbody">
      <article id="post-0" class="post no-results not-found">
         <header class="entry-header">
            <h1 class="entry-title"><?php _e( 'Nothing Found', GKTPLNAME ); ?></h1>
         </header>

         <div class="entry-content">
            <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', GKTPLNAME ); ?></p>
            <?php get_search_form(); ?>
         </div>
      </article>
   </section>
<?php endif; ?>

<?php

gk_load('after');
gk_load('footer');

// EOF


Perhaps You should redownload theme.
User avatar
Moderator

GK User
Thu May 09, 2013 2:24 pm
Isn't the updating process automatic from the WP backend ?
I look in the backend, under updates, in theme options, and this is what I see.

I have to update the theme by hand ? Manually, by FTP ?

Image
User avatar
Expert Boarder

GK User
Thu May 09, 2013 2:37 pm
Ill try to figure out why You have the same theme version but different file.
User avatar
Moderator

GK User
Thu May 09, 2013 2:38 pm
Now you got me really confused. How come I have such an old file in my theme meanwhile it says in the backend that my theme is up to date ?

What is the process for updating the theme ?

I unzip and FTP the entire foder over to the Fest directory and replace the files ?

What do I do ? Can you clarify ? Or maybe a link with instructions in documentation for the theme ?

I'm sorry to bother you like this.
User avatar
Expert Boarder

GK User
Thu May 09, 2013 3:04 pm
ragots wrote:I unzip and FTP the entire foder over to the Fest directory and replace the files ?


This is the simplest way that usually works great, but keep in mind files that You have edited in theme folder already and back them up firstly.
Even if You didnt change anything, backing up "Fest" catalog in wp-content/themes before changing anything would be a good step.
User avatar
Moderator

GK User
Fri May 10, 2013 9:52 am
Ok, I have made a mistake and took file from developer version of template that will be published soon.

Please make this change to your file:

Code: Select all
<?php
/*
Template Name: Latest Posts
*/

global $tpl;

gk_load('header');
gk_load('before');

global $more;
$more = 0;

// get the page number
$paged = (get_query_var('paged')) ? get_query_var('paged') : ((get_query_var('page')) ? get_query_var('page') : 1);

query_posts('posts_per_page=' . get_option('posts_per_page') . '&paged=' . $paged );

?>

<?php if ( have_posts() ) : ?>
   <section id="gk-mainbody">
      <?php gk_content_nav(); ?>
     
      <?php while ( have_posts() ) : the_post(); ?>
         <?php get_template_part( 'content', get_post_format() ); ?>
      <?php endwhile; ?>
     
      <?php gk_content_nav(); ?>
     
      <?php wp_reset_query(); ?>
   </section>
<?php else : ?>
   <section id="gk-mainbody">
      <article id="post-0" class="post no-results not-found">
         <header class="entry-header">
            <h1 class="entry-title"><?php _e( 'Nothing Found', GKTPLNAME ); ?></h1>
         </header>

         <div class="entry-content">
            <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', GKTPLNAME ); ?></p>
            <?php get_search_form(); ?>
         </div>
      </article>
   </section>
<?php endif; ?>

<?php

gk_load('after');
gk_load('footer');

// EOF
User avatar
Moderator

GK User
Sat May 11, 2013 5:06 pm
I made a comparaison between the first file you offered and this last one, they are identical.
But it seems to be working now, the pagination…


Image
User avatar
Expert Boarder


cron