[wp-hackers] Sticky posts turning up in my custom WP Queries

Austin Matzko if.website at gmail.com
Wed May 13 18:36:13 GMT 2009


On Wed, May 13, 2009 at 1:08 PM, Simon Wheatley
<simon at sweetinteraction.com> wrote:
> $args = array(
>        'post_type' => $post_type,
>        'what_to_show' => 'posts',
>        'post_status' => 'publish',
>        'posts_per_page' => $num_posts,
>        'orderby' => 'modified',
>        'order' => 'DESC',
>        's' => $search_string,
> );
>
> $my_query = new WP_Query( $args );
>
> Unfortunate thing 1: it seems that this query gets interpreted as
> is_home = true, this is because of this line in WP_Query:
>
> if ( !( $this->is_singular || $this->is_archive || $this->is_search ||
> $this->is_feed || $this->is_trackback || $this->is_404 ||
> $this->is_admin || $this->is_comments_popup ) )

So, what's in your $search_string variable?  That should make
$this->is_search true.


More information about the wp-hackers mailing list