Thanks for your patience and support @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 7 years, 10 months ago by Ike Ten.
-
This reply was modified 7 years, 10 months ago by Ike Ten.