• Hello,

    I have a problem with WP_Query and Search Parameter.
    Following my code:

    $selection = array(
    ‘post_type’ => $posttype,
    ‘s’ => $search,
    ‘posts_per_page’ => 10
    );

    I get the value of $search by a GET[].
    And below my loop.

    <?php
    $query = new WP_Query( $selection );?>
    <?php while ( $query->have_posts() ) : $query->the_post(); ?>
    <h2><?php the_title(); ?></h2>
    <?php endwhile; ?>

    My problem is that I NOT obtain any receipts if $search equal something and I am sure that I should have 3 receipts.

    Does anyone has an idea? Should I change my search.php? I use the standard template “twentythirteen”.
    Does anyone know how to use Search parameter?

    Thanks in advance.
    Best regards,
    Gwen.

  • The topic ‘Problem with WP_Query and Search Parameter’ is closed to new replies.