0

I have a WP_Query like this.

    <?php
        $quote_args = array(
            'post_type' => 'post',
            'category_name' => 'quote',
            'orderby' => 'rand',
            'posts_per_page' => 1
        );

        $quote  = new WP_Query($quote_args);

        if($quote->have_posts()):
            while($quote->have_posts()):
                $quote->the_post();
    ?>
    <div id="testimonialWrap">  
        <p class="testimonial">
            <?php the_content_rss(); ?>
            <span><?php echo the_title(); ?></span>
            <em></em>
        </p>
    </div>
    <?php
        endwhile;
        endif;
    ?>

It just randomly selects posts that are quotes.

My questions is the $quote_args array has a group of key / value pairs: ('post_type' => 'post')

Is there a list of the keys that can be used here. Is there a name for these key / value pairs.

1 Answer 1

2

Is there a list of the keys that can be used here. Is there a name for these key / value pairs.

The "list" is in the Codex on the WP_Query page or you can just check the source.

I don't know what kind of "name" you are looking for. Other that "key/value" I'd call them "arguments" or "parameters" (as does the Codex). I really don't understand that part of the question.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.