Skip to content

Instantly share code, notes, and snippets.

@ajaydsouza
Last active January 10, 2021 14:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajaydsouza/82d122a2d318418b427aae45e7c8c3fa to your computer and use it in GitHub Desktop.
Save ajaydsouza/82d122a2d318418b427aae45e7c8c3fa to your computer and use it in GitHub Desktop.
CRP_Query Examples
<?php
// The Query.
$the_query = new CRP_Query( $args );
// The Loop.
if ( $the_query->have_posts() ) {
echo '<ul>';
while ( $the_query->have_posts() ) {
$the_query->the_post();
echo '<li>' . get_the_title() . '</li>';
}
echo '</ul>';
} else {
// no posts found.
}
/* Restore original Post Data */
wp_reset_postdata();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment