Custom query with post_class filter using current_post not working
You are using the global $wp_query not your custom query. Either declare yours global too like global $wp_query_archives and then use that in the sm_inline_post_class callback while being aware of the drawbacks of using global variables or do a little work like so: $class = sm_inline_post_class( array(), $my_custom_query ); And then pass $class as the … Read more