• hello!
    i have problem with query_posts, it returns nothing to me, idont know what is wrong with my code so could anyone check it and say me wheres and arror?

    $don=array(1,182,345,52,90,32,43,56,221,117);
    query_posts("post__in=>$don&post_per_page=7&paged=".$paged);

Viewing 3 replies - 1 through 3 (of 3 total)
  • change => to = in query_posts args.

    Thread Starter axxxon

    (@axxxon)

    still no efect, nothing returned from query_posts…

    You’re passing an array into a string, it won’t work… that string will end up being read as..

    post__in=Array()&post_per_page=7&paged=n

    Use an array..

    $args = array(
      'post__in' => array( 1,182,345,52,90,32,43,56,221,117 ),
      'posts_per_page' => 7
    );
    // Shouldn't need $paged if you merge with the existing query args
    $args = array_merge( $args, $wp_query->query );
    
    query_posts( $args );

    Hope that helps..

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘query_posts strange’ is closed to new replies.