I need to do wordpress custom fields loop: here is the code to describe better:
<?php
$term = get_term_by('slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
$query = new WP_Query(array(
'post_type' => 'recipe',
'meta_key' => 'recipe_star_rating',
'orderby' => 'meta_value_num',
'order' => 'DESC',
// 'taxonomy' => 'difficulty',
));
global $wp_query;
$total_results = $wp_query->found_posts;
echo '<h2>"'.$term->name . '" Recipes</h2>';
echo '<h4 class="tcount">'. $total_results . ' results</h4>'; ?>
<hr class="aloha" />
<?php order_properties_menu(); ?>
<hr class="aloha" />
<?php $counter = 0; ?>
<?php while ($query->have_posts()): $query->the_post(); ?>
<div class="col-md-12 col-sm-6 col-xs-12">
<?php echo Chefscuisine_Template_Loader::load( 'recipes/grid' ); ?>
</div>
<?php $counter++; endwhile; ?>
<? if ($counter % 4 === 0) {
echo '<div class="midad">Advert 336x280px Here!</div>';
} ?>
I got listing but I need now by tahonomy eg. average-difficulty from taxonomy template, how to make it just by average difficulty or easy to cook thta are custom fields. Its pulling from category template called taxonomy-difficulties.php