All Good Things Must Come To An End

As you all know, I have been doing WordPress plugins and supporting it for the past 6 years. These 6 years of my life, I have been through my polytechnic education, my national service as well as my university education.

I just graduated from university in December 2009 and have been looking for full-time jobs. I am offered a full-time job and will be starting work on 1st February 2010.

I regret to say that I am NOT ABLE to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

However, I WILL still update my plugins whenever I can and you still can report bugs to me via email and I will try to fix it.

Author Topic: will not retrieve "paged" information  (Read 3037 times)

0 Members and 1 Guest are viewing this topic.

Offline havahula

  • Newbie
  • *
  • Posts: 4
    • View Profile
will not retrieve "paged" information
« on: 02 February 2009, 01:00 »
I've looked through every post about query_posts on the forum but none seem to work for me. Here are my basic details:

    * WordPress 2.7
    * Own Theme
    * http://boundlessyoga.com/events/studio-events/
    * WP-Pagenavi 2.40
    * PHP 4 & MySQL 4.1.22
    * No conflicts

When I first installed this on a custom page template using only query_posts('cat=4'); it worked fine BUT clicking on the different page URLs didn't actually take me to the different posts, keeping me stuck on the first 10 results.

Then I found this article online:
http://www.michaelciccarelli.com/2008/07/fix-pagination-on-query-posts/

Which advised generating the following code:
                $limit = get_option('posts_per_page');
      $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
      $more = 0;
      query_posts('showposts=' . $limit . '&paged=' . $paged .'&cat=4');
      $wp_query->is_archive = true; $wp_query->is_home = false;

which ended up working fine for a few days but then we noticed that it stopped working completely.

I did everything I could think of -- trying just the normal archives, turning off all other plugins, re-installing the plugin, resetting to my original query_posts(); code and then trying your recommended code:
$paged = intval(get_query_var('paged'));
if($paged == 0) {
$paged = 1;
}
query_posts("posts_per_page=6&cat=$cat&paged=$paged");

on this page:
http://forums.lesterchan.net/index.php/topic,2027.0.html

but still, even with the "always show page navigation" set to "yes" I only get "Page 1 of )"

I have NO idea why. I've used this plugin several times before and never with this freaky result. Any help you can offer would be great. Thanks!

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,692
    • View Profile
  • WordPress Version: WordPress 3.0.x
  • Theme Name: lesterchan.net v3.4
Re: will not retrieve "paged" information
« Reply #1 on: 02 February 2009, 03:32 »
http://codex.wordpress.org/Template_Tags/query_posts


You try to see this code does it work first:
Code: [Select]
query_posts($query_string . "&posts_per_page=6&cat=$cat")

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline havahula

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: will not retrieve "paged" information
« Reply #2 on: 02 February 2009, 13:45 »
Thanks, Lester but that's the weird thing -- when I use that code I get no results. I honestly don't know what is going on...

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,692
    • View Profile
  • WordPress Version: WordPress 3.0.x
  • Theme Name: lesterchan.net v3.4
Re: will not retrieve "paged" information
« Reply #3 on: 02 February 2009, 14:07 »
Can you try on the default theme index.php with no other plugins activated except WP-PageNavi?

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline havahula

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: will not retrieve "paged" information
« Reply #4 on: 02 February 2009, 14:29 »
That doesn't work either. Have you ever seen this?

Here is the code I used:
query_posts($query_string . "&posts_per_page=6&cat=66,4");


Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,692
    • View Profile
  • WordPress Version: WordPress 3.0.x
  • Theme Name: lesterchan.net v3.4
Re: will not retrieve "paged" information
« Reply #5 on: 02 February 2009, 15:49 »
I just notice, you pasted this in a page.php?

What about just
Code: [Select]
query_posts($query_string . "&cat=66,4");
I created a page template called blog.php

Code: [Select]
<?php
/*
Template Name: Blog
*/
?>

<?php get_header(); ?>
<?php query_posts('paged='.get_query_var('paged')); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2 style="text-align: center;"><?php the_date() ?></h2>
<h3><span><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></span></h3>
<small>Posted by <?php the_author() ?> at <?php the_time(); ?> in <?php the_category(', '?></small>

<div class="entry">
<?php the_content('Read the rest of this entry &raquo;'); ?>
</div>
<?php the_tags'<p>Tags: '', ''</p>'); ?>
<p style="text-align: center;"><?php edit_post_link('Edit'''' | '); ?><?php comments_popup_link('No Comments''1 Comment''% Comments'); ?> | <?php if(function_exists('the_views')) { the_views(); }?></p>
<div>
<span style="float: left">
<?php if(function_exists('wp_email')) { email_link(); }  ?>
</span>
<span style="float: right">
<?php if(function_exists('print_link')) { print_link(); } ?>
</span>
</div>
</div>
<p>&nbsp;</p>
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('&laquo; Older Entries'?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;'?></div>
</div>
<?php else : ?>
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
<?php endif; ?>
<div>
<p>&nbsp;</p>
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
</div>
<br class="clear" />
<?php get_footer(); ?>

It works fine for me

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline havahula

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: will not retrieve "paged" information
« Reply #6 on: 02 February 2009, 17:27 »
this is amazing. I used your template verbatim and it works. however, copying your query into my templates breaks the plugin EVEN IF i remove all of my other function calls save only yours.

Then I found a second query_posts call buried in an include that came between the initial query_posts call and your function call. THAT was it.

I am so sorry, Lester -- I owe you big for wasting your time on my own stupid oversight.

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,692
    • View Profile
  • WordPress Version: WordPress 3.0.x
  • Theme Name: lesterchan.net v3.4
Re: will not retrieve "paged" information
« Reply #7 on: 02 February 2009, 17:41 »
no worries  :D

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.