I have a template called taxonomy-book_style.php to handle all the terms in book_style. On it I just have a simple loop
<?php if (have_posts()) : while (have_posts()) : the_post();?>
I would like to order my posts by the meta key value found in the meta_key tf_book_sort
So far I've tried these but they do not work:
<?php
query_posts( $query_string . 'orderby=meta_value&meta_key=tf_book_sort&order=ASC' );?>
<?php if (have_posts()) : while (have_posts()) : the_post();?>
<?php if (have_posts()) : while (have_posts()) : the_post('meta_key=tf_book_sort&orderby=meta_value&order=ASC'); ?>
<?php
$args = array(
'tax_query' => array(array('taxonomy' => 'book_style')),
'meta_key' => 'tf_book_sort',
'orderby' => 'meta_value',
'order' => 'DESC'
);?>
<?php query_posts ($args);?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
The nested arrays are confusing, can someone please suggest a proper synatx to accomplish sorting these posts by a meta key value?
Thank You.
