Get_term_meta() does not work with pre_get_posts()

I finally, finally figured it out! I was not able to get the category id in the first place. Strangely, get_query_var(‘cat’) is not working. Here is the way that worked for me, in case someone else also struggles with this: function my_new_category_order( $query ) { $category = get_queried_object(); $cat_id = $category->term_id; $post_order = get_term_meta($cat_id, ‘post-order’, … Read more