[wp-hackers] new WP_Query filter with meta_value and with pagination - unexpected behaviour

Ash Goodman ash at thinkinginvain.com
Tue Apr 27 03:58:50 UTC 2010


I have better determined what the problem seems to be. The strangeness of it
is that its behaviour seems to change from computer to computer. The problem
seems to be with the permalinks. Using the default permalink structure I
should see the following permalink on the first page pointing to the 2nd
page:

http://mydomainname.com/?page_id=27&paged=2

And on the 2nd page:

http://mydomainname.com/?page_id=27&paged=3

On 3 out of 4 PC's I do see that, on the 4th the page_id parameter is
missing. All 4 PC's are looking that the exact same page pulled from the
exact same wordpress installation. All are using windows, all are using the
same version of firefox. No plugins are active.

In the instances when it is working it stops working if I change from the
default permalink structure to  a custom one.

Is this a known bug? I see references online to permalink issues and
pagination, but none of them quite describe what I am seeing.

If it is a bug, the references I am seeing go back to 2006 (part of why I
think its not the same bug)? Any idea when this bug might be fixed?

On 26 April 2010 20:00, <wp-hackers-request at lists.automattic.com> wrote:

> Send wp-hackers mailing list submissions to
>        wp-hackers at lists.automattic.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://lists.automattic.com/mailman/listinfo/wp-hackers
> or, via email, send a message with subject or body 'help' to
>        wp-hackers-request at lists.automattic.com
>
> You can reach the person managing the list at
>        wp-hackers-owner at lists.automattic.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of wp-hackers digest..."
>
>
> Today's Topics:
>
>   1. Re: Customising date based URLs to use a 2 digit year
>      (Christian Foster)
>   2. new WP_Query filter with meta_value and with      pagination -
>      unexpected behaviour (Ash Goodman)
>   3. Re: how to apply a theme only for a page (Khaleel Abdul Karim)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 26 Apr 2010 15:17:15 +1000
> From: Christian Foster <christian.foster at gmail.com>
> Subject: Re: [wp-hackers] Customising date based URLs to use a 2 digit
>        year
> To: wp-hackers at lists.automattic.com
> Message-ID:
>        <n2i89a1851d1004252217v35a40c62hd8caeac114437cc1 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Yes, that was the initial thought but he would like to keep them in
> the same format - having looked through all the rewrite rules I think
> it is possible by replacing the 4 digit year to 2, and adding 20 to
> the front of the year query variable. He doesn't have anything before
> 2000.
>
> On Mon, Apr 26, 2010 at 12:31 AM, Mike Schinkel
> <mikeschinkel at newclarity.net> wrote:
> > Have you considered doing 301 redirects from the old format to the new
> format? ?If viable you can do that in the .htaccess file or using the
> "template_redirect" hook by sniffing $_SERVER['REQUEST_URI'].
> >
> > -Mike
> >
> > On Apr 25, 2010, at 8:55 AM, Christian Foster wrote:
> >
> >> Hi all,
> >>
> >> I have been a bit stumped by this and can't find a solution anywhere -
> >> a potential client wants to move from Moveable Type to Wordpress. His
> >> MT urls are in the format http://site.com/YY/MM/DD and he posts one
> >> post per day (always!).
> >>
> >> Does anyone know if there a way for Wordpress to
> >> a) use a 2 digit year instead of 4 and
> >> b) get wordpress to pick up the post for that date on the single day
> >> URL instead of showing the single day archive (My thoughts are to
> >> write a custom template for the daily archive and change the query to
> >> pick up the 1 post for that day)?
> >> c) remove the normal wordpress URL for the individual posts? My
> >> initial thoughts are to filter the permalinks to point to the date of
> >> the post.
> >>
> >> Regards,
> >>
> >> Christian.
> >> _______________________________________________
> >> wp-hackers mailing list
> >> wp-hackers at lists.automattic.com
> >> http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
>
>
> ------------------------------
>
> Message: 2
> Date: Mon, 26 Apr 2010 17:40:15 +0800
> From: Ash Goodman <ash at thinkinginvain.com>
> Subject: [wp-hackers] new WP_Query filter with meta_value and with
>        pagination - unexpected behaviour
> To: wp-hackers at lists.automattic.com
> Message-ID:
>        <j2l1d9b57821004260240n54e096bw967e0c7fb593a635 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi all
>
> I have found some strange behaviour when using a new WP_Query and filtering
> the loop with meta_value=
>
> as shown below ( on my front_page )
>
> <?php $temp = $wp_query;
> $wp_query= null;
> $wp_query = new
>
> WP_Query("showposts=1&meta_value=_fprofile&post_type=page"."&paged=".$paged);
> while($wp_query->have_posts()) : $wp_query->the_post();?>
>
> The problem is pagination is not working properly. When I click the next
> page link I am taken out of my loop and into the loop found on index.php
> Meaning into the normal blog post link giving me posts instead of pages, no
> meta_value filter and 10 post per page instead of 1. It seems to switch
> loops?
>
> This problem is eliminated by making the loop on index.php fire only if
> is_home()
>
> <?php if(is_home()) {?>
>
> Normal blog post loop
>
> <?php }else{?>
> <!-- do nothing -->
> <?php } ?>
>
>
> This doesn't seem to cause any other problems so I am hopeful the situation
> is sorted, BUT
>
> It feels kind of off to me somehow. Is the behaviour I am seeing expected
> or
> is it a bug? Should my loop switch like that on going to the second page?
> And is my fix ok or is it likely to cause other problems - for example
> screw
> with categories or archives?
>
> Thanks!
>
> Ash
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 26 Apr 2010 16:20:04 +0530
> From: Khaleel Abdul Karim <webmaster887 at gmail.com>
> Subject: Re: [wp-hackers] how to apply a theme only for a page
> To: wp-hackers at lists.automattic.com
> Message-ID:
>        <q2m45e39f721004260350xad46a025nb47fa7fca5540526 at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> I have resolved it myself . The problem is with the template filter ... The
> post id is not loading in the function
>
> On Sun, Apr 25, 2010 at 12:19 AM, Elizabeth Buckwalter <
> elizabeth at slatetechpdx.com> wrote:
>
> >
> >
> > Sent from my iPhone
> >
> >  Message: 1
> >> Date: Fri, 23 Apr 2010 17:45:44 +0530
> >> From: Khaleel Abdul Karim <webmaster887 at gmail.com>
> >> Subject: Re: [wp-hackers] how to apply a theme only for a page
> >> To: wp-hackers at lists.automattic.com
> >> Message-ID:
> >>   <p2g45e39f721004230515vfa3ed2ddxadbe1330120300df at mail.gmail.com>
> >> Content-Type: text/plain; charset=UTF-8
> >>
> >>
> >> Anyone please help me over this to find a solution ...
> >>
> >> On Thu, Apr 22, 2010 at 7:09 PM, Khaleel Abdul Karim <
> >> webmaster887 at gmail.com
> >>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>
> >>>
> >>>
> >>>
> >
> >
> http://www.webdesignerwall.com/trends/unique-blog-posts-and-wordpress-tips/
> >
> > Examples and a howto at the bottom
> >
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
>
>
>
> --
> ~~~~~~~~~~~~~~~~~~
> http://khaleel.isgreat.org
> Khaleel Abdul Karim
> Thazhathuveedu
> Erumely
>
>
> ------------------------------
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
>
> End of wp-hackers Digest, Vol 63, Issue 55
> ******************************************
>


More information about the wp-hackers mailing list