Skip to content

Instantly share code, notes, and snippets.

@technosailor
Created August 30, 2012 21:24
Show Gist options
  • Save technosailor/3541464 to your computer and use it in GitHub Desktop.
Save technosailor/3541464 to your computer and use it in GitHub Desktop.
<?php
function tgm_beauty_review_layout() {
global $amm_core;
global $wp_query;
$paged = ( get_query_var('page') ) ? get_query_var( 'page' ) : 1;
$wp_query = new WP_Query(
array(
'paged' => $paged,
'post_status' => 'publish',
'posts_per_page' => 5,
'post_type' => 'reviews',
'meta_query' => array(
array(
'key' => 'review_type',
'value' => 'treatment'
)
),
)
);
if( have_posts() )
{
while( have_posts() ) : the_post();
// Do stuff
endwhile;
wp_pagenavi();
echo '</div>';
}
else
{
echo '<p>There are no reviews.</p>';
}
wp_reset_query();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment