Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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.

share|improve this answer
    
I was going to call them arguments - this is what I was looking for. billerickson.net/code/wp_query-arguments –  Simon Cooper Aug 8 '13 at 14:58
2  
The WP_Query link provided by s_ha_dum's answer has more people looking at it and keeping it updated than Bill's code. Bill's a great person, but ... –  Charles Clarkson Aug 8 '13 at 15:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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