Problem using reverse order filter
-
I’m attempting to set several categories to display posts in reverse chronological order. (A simple per-category setting to make the default sort order one of the three filter options you’ve got would be great, by the way.)
Anyway, below is the code for my first attempt. I know the category ID is correct, but nothing is happening either on the sorting page or when viewing the category page.
add_filter('reorder_posts_within_category_initial_order', 'reverse_order', 10, 3); function reverse_order($reverse, $post_type, $term_id){ $reverse = true; $post_type = "post"; $term_id = 184; return true; }
Could you please let me know what’s wrong with the code, and also clarify where I should see the difference (sorting page, frontend, or both), and whether I need to turn on manual sorting for the category as well as using this filter?
I’ve tried a bunch of things with this filter and not gotten it to work, but I’m not confident enough I understand it to say this is a bug.
I appreciate your help.
P.S. I’m running the version that just came out this morning. (2.0.1, I think?)
- The topic ‘Problem using reverse order filter’ is closed to new replies.