Category Order Not working
-
This plug-in is not working correctly when using the function mylinkorder_list_bookmarks(array(“category_orderby” => “term_order”, “orderby” => “link_order”)); to order the link categories.
It orders the links correctly, just not the categories. I narrowed this down to an issue in taxonomy.php where it renames the orderby field name to t.name if it is a field that is not recognized.
I changed the code in the mylinkorder_list_bookmarks function and got it to work.
addglobal $wpdb;
to the top of the function
then replace
$cats = get_terms('link_category', array('name__like' => $category_name, 'include' => $category, 'exclude' => $exclude_category, 'orderby' => $category_orderby, 'order' => $category_order, 'hierarchical' => 0));
with$query = "SELECT DISTINCT t.term_id, name FROM $wpdb->term_taxonomy tt inner join $wpdb->term_relationships tr on tt.term_taxonomy_id = tr.term_taxonomy_id inner join $wpdb->terms t on t.term_id = tt.term_id where taxonomy = 'link_category' ORDER BY t.".$category_orderby." ". $category_order; $cats=$wpdb->get_results($query);
- The topic ‘Category Order Not working’ is closed to new replies.