Trying to ignore sort for specific post types
-
This plugin is conflicting with Toolset Views, so I’m trying to write a function to ignore Post Type Order on a specific post type. What do I need to adjust on the following code to make this work?
add_filter('pto/posts_orderby/ignore', 'theme_pto_posts_orderby', 10, 2); function theme_pto_posts_orderby($ignore, $orderBy, $query){ if(($query->query_vars['post_type'] == 'game') || (is_array($query->query_vars['post_type'][0] == 'game'))){ $ignore = true; return $ignore; } return $orderBy; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Trying to ignore sort for specific post types’ is closed to new replies.