WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Problem with calling query_posts()

[Resolved] Problem with calling query_posts()

  • Hey ,

    I am running XAMPP latest version and WP 3.0.
    Problem
    When I try to use query_posts() for retrieving posts by slugs.
    I am getting this error

    Warning: trim() expects parameter 1 to be string, array given in C:\xampp\htdocs\wordpress\wp-includes\query.php on line 1272

    for code
    <backticks>
    <?php

    get_header();
    query_posts(array(‘name’=>array(‘guitar’,’movie-post’)));

    if (have_posts()) :
    while (have_posts()) :
    the_post();
    the_content();
    endwhile;
    endif;
    get_sidebar();
    get_footer();
    ?>
    I</backticks>

    What is wrong with this ? If I cannot use this , can you please suggest alternatives? This works when I put query as ‘name=guitar’

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Problem with calling query_posts()’ is closed to new replies.
Skip to toolbar