[wp-hackers] get_posts problem...

Mr. Awesome theone.andonly.mr.awesome at gmail.com
Wed Mar 5 02:49:34 GMT 2008


Jeremy Visser wrote:
> On Tue, 2008-03-04 at 19:59 -0600, Dan Larkin wrote:
>   
>> I could be mistaken, but it seems a bit odd to have "$wp_query =
>> $wp_old_query;" twice.  I believe the first one should be removed?
>>     
>
> I actually meant for him to make the first occurance before endwhile to
> be this:
>
> global $wp_query, $wp_old_query;
>
> I think he misinterpreted me.

No, I copied the code from our GTalk directly ...

Jeremy: this is my code:
<?php

global $wp_query, $wp_old_query;
$wp_old_query = $wp_query;

query_posts('numberposts=10&offset=0');

while ( have_posts() ) :
the_post();

?>

Spencer: <?php

endwhile;
$wp_query = $wp_old_query;

?>
where in there?


Jeremy: after the <?php


Spencer: its already there
u put it there in the email of urs
this
<?php

endwhile;
$wp_query = $wp_old_query;

?>


Jeremy: <?php

global $wp_query, $wp_old_query;
endwhile;
$wp_query = $wp_old_query;

?>

Spencer: nope still no go
show two posts in author page instead of one..

I did try that last suggestion... still didn't work.. =(

I thought Dan was talking about this part of this code..

global $wp_query, $wp_old_query;
$wp_old_query = $wp_query;


<?php

global $wp_query, $wp_old_query;
$wp_old_query = $wp_query;

query_posts('numberposts=10&offset=0');

while ( have_posts() ) :
the_post();

?>

I removed the FIRST line: global $wp_query, $wp_old_query; and tried 
that like this..

<?php

$wp_old_query = $wp_query;

query_posts('numberposts=10&offset=0');

while ( have_posts() ) :
the_post();

?>

Did same thing as before too...


More information about the wp-hackers mailing list