Not working (sorry) – tried the FAQ workarounds
-
hey,
Firstly, thanks for the plugin, it is something I really need! However, it is not working for me in a reordering sense on the front end (I can reorder fine on the backend). I’ve tried adding orderby explicitly in my query and setting override on as per the FAQ #10 explaination. Here is my query –
$term = get_term_by( ‘slug’ , get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) );
$posts_array = get_posts(
array(
‘posts_per_page’ => 40,
‘post_type’ => ‘speaker’,
‘tax_query’ => array(
‘orderby’ => ‘menu_order’,
‘sort_order’ => ‘asc’,
array(
‘taxonomy’ => ‘speaker_category’,
‘field’ => ‘term_id’,
‘terms’ => $term->term_id
)
)
)
);Originally it didn’t have orderby and the sorting didn’t work. In FAQ #10, there is a line –
//check this is the correct query
if($wp_query….){
$override = true;
}
What should $wp_query be checking against here to make sure it is the right query?I’ve also tried the second part of FAQ#10 to no avail by doing –
add_filter(‘reorderpwc_filter_multiple_post_type’, ‘filter_my_ranked_post_type’, 10, 4);
function filter_my_ranked_post_type($type, $post_types, $taxonomy, $wp_query){
/* String $type post type to filter.
* String $post_types post types associated with taxonomy.
* String $taxonomy being queried.
* WP_Query $wp_query query object. */
if(‘categories’ == $taxonomy && in_array(‘speakers’,$post_types)) $type = ‘speakers’;
return $type;
}Is this right (assuming ‘categories’ is the taxonomy name and ‘speakers’ is the custom post type?
- The topic ‘Not working (sorry) – tried the FAQ workarounds’ is closed to new replies.