[wp-testers] Something odd happening with WP_Query()

Jacob Santos wordpress at santosj.name
Sat Nov 29 19:24:17 GMT 2008


Is it worth noting that the example from MichaelH will only work on 
PHP5+? No. Carry on then.

Jacob Santos

Paul Robinson wrote:
> Ahhh thank you. It turned out it was due to not storing and then nulling the
> standard WordPress query like that post said to do.
>
> Thanks.
> Paul.
>
> 2008/11/29 Michael E. Hancock <justmichaelh at gmail.com>
>
>   
>> ----- Original Message ----- From: "Paul Robinson" <
>> pablorobinson at gmail.com>
>>
>>     
>>> Sooooo I was wonding if anyone could shed some light on why the_tags()
>>> isn't
>>> working inside a WP_Query(); loop. I'm not sure if it's a new thing which
>>> is
>>> why I'm posting it in this list.
>>>
>>>       
>> Ronald Huereca (and Aaron's comments) in
>> http://weblogtoolscollection.com/archives/2008/04/19/paging-and-custom-wordpress-loops/explain why this works:
>>
>> <ul>
>> <?php
>> $temp = $wp_query;
>> $wp_query= null;
>> $wp_query = new WP_Query();
>> $wp_query->query('category_name=Featured&showposts=1'.'&paged='.$paged);
>> ?>
>> <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
>> <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title();
>> ?></a></li>
>>  <li><a href="<?php the_tags() ?></li>
>> <?php endwhile; ?>
>> </ul>
>> <?php $wp_query = null; $wp_query = $temp;?>
>>
>>
>> MichaelH
>>
>>
>> _______________________________________________
>> wp-testers mailing list
>> wp-testers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-testers
>>
>>     
> _______________________________________________
> wp-testers mailing list
> wp-testers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-testers
>   



More information about the wp-testers mailing list