Title: Query Parameters
Last modified: January 6, 2017

---

# Query Parameters

 *  Resolved [Ike Ten](https://wordpress.org/support/users/ike-ten/)
 * (@ike-ten)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/query-parameters/)
 * Hi [@archetyped](https://wordpress.org/support/users/archetyped/),
 * Can you give examples for using parameters in cornerstone query?
    Am trying to
   filter posts that display with parameter. Example
 *     ```
       $args = array(
       	'post_type'  => 'my_custom_post_type',
       	'meta_key'   => 'age',
       	'orderby'    => 'meta_value_num',
       	'order'      => 'ASC',
       	'meta_query' => array(
       		array(
       			'key'     => 'age',
       			'value'   => array( 3, 4 ),
       			'compare' => 'IN',
       		),
       	),
       );
       ```
   
 * Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Archetyped](https://wordpress.org/support/users/archetyped/)
 * (@archetyped)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/query-parameters/#post-8627434)
 * Hi, Cornerstone supports the same parameters as WordPress’ own `get_posts()` 
   function. See the [official `get_posts()` documentation](https://codex.wordpress.org/Template_Tags/get_posts)
   for more details.
 *  Thread Starter [Ike Ten](https://wordpress.org/support/users/ike-ten/)
 * (@ike-ten)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/query-parameters/#post-8627571)
 * Thanks for the heads up.
    Will try it now. Giving a good example here would be
   great and beneficial to future users [@archetyped](https://wordpress.org/support/users/archetyped/).
   There’s so little info on your plugin on the web, makes me believe most users
   are advanced yet not all users are same. Some may need some few examples here
   and there. Kindly include loop examples like this on your knowledge base on your
   site. 🙂
 * Thanks again
    -  This reply was modified 9 years, 4 months ago by [Ike Ten](https://wordpress.org/support/users/ike-ten/).
 *  Plugin Author [Archetyped](https://wordpress.org/support/users/archetyped/)
 * (@archetyped)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/query-parameters/#post-8627716)
 * Thanks for the feedback [@ike-ten](https://wordpress.org/support/users/ike-ten/),
   I appreciate it.
 *  Thread Starter [Ike Ten](https://wordpress.org/support/users/ike-ten/)
 * (@ike-ten)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/query-parameters/#post-8627806)
 * You welcome [@archetyped](https://wordpress.org/support/users/archetyped/).
 * And am still waiting for the loop with Query Parameters example with cornerstone:).
   
   Am still learning myself hence an example will really help :). I went through
   the get_post() docs yet am still not very clear on the implementation.
 * Thanks
    -  This reply was modified 9 years, 4 months ago by [Ike Ten](https://wordpress.org/support/users/ike-ten/).
 *  Plugin Author [Archetyped](https://wordpress.org/support/users/archetyped/)
 * (@archetyped)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/query-parameters/#post-8630342)
 * Just as with `get_posts()`, the parameters you would use really depend on how
   you want to modify the results of the query. Standard use does not require any
   additional parameters.
 *  Thread Starter [Ike Ten](https://wordpress.org/support/users/ike-ten/)
 * (@ike-ten)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/query-parameters/#post-8630560)
 * Thanks for your patience and support [@archetyped](https://wordpress.org/support/users/archetyped/),
 * Yes I understand the parameters used really depend on how I wish to modify the
   results of the query. I finally want to come clear with a good example.
 * If I wanted to query only 10 Latest posts ordered by title with post status of
   published using `get_posts()` I would do something like this below
 *     ```
       <?php
       $args = array( 'posts_per_page' => 10, 'post_status' => 'publish', 'order'=> 'ASC', 'orderby' => 'title' );
       $postslist = get_posts( $args );
       foreach ( $postslist as $post ) :
         setup_postdata( $post ); ?> 
       	<div>
       		<?php the_date(); ?>
       		<br />
       		<?php the_title(); ?>   
       		<?php the_excerpt(); ?>
       	</div>
       <?php
       endforeach; 
       wp_reset_postdata();
       ?>
       ```
   
 * How can I do same with cornerstone? My issue is with this part `$postslist = 
   get_posts( $args );` where the `$args` is introduced.
 * With `get_posts()` I know where to include the `$args` but with cornerstone am
   a bit not clear where to include the `$args` in the code `<?php if ( cnr_have_children()):
   while ( cnr_have_children() ) : cnr_next_child(); ?>`.
 * An example loop with the above parameter using the cornerstone loop can really
   help clear things up for me.
 * Thanks again.
    -  This reply was modified 9 years, 4 months ago by [Ike Ten](https://wordpress.org/support/users/ike-ten/).
    -  This reply was modified 9 years, 4 months ago by [Ike Ten](https://wordpress.org/support/users/ike-ten/).
 *  Thread Starter [Ike Ten](https://wordpress.org/support/users/ike-ten/)
 * (@ike-ten)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/query-parameters/#post-8637174)
 * Hello [@archetyped](https://wordpress.org/support/users/archetyped/) ??
 *  Plugin Author [Archetyped](https://wordpress.org/support/users/archetyped/)
 * (@archetyped)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/query-parameters/#post-8718273)
 * Hi, thanks for the additional details for clarification. Cornerstone does not
   currently support custom queries like that, though it is planned for a future
   update.
 * I’m not sure if it will work, but you may get the results you want by adding 
   the `post_parent` parameter to a custom `WP_Query` query ([documentation](https://codex.wordpress.org/Class_Reference/WP_Query)).
   Set the value of `post_parent` to the current section using `cnr_get_the_section()`.
   See more section-specific functions in Cornerstone’s `functions.php` file.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Query Parameters’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/cornerstone.svg)
 * [Cornerstone](https://wordpress.org/plugins/cornerstone/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cornerstone/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cornerstone/)
 * [Active Topics](https://wordpress.org/support/plugin/cornerstone/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cornerstone/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cornerstone/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [Archetyped](https://wordpress.org/support/users/archetyped/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/query-parameters/#post-8718273)
 * Status: resolved