Issue Excluding Normal Posts from Custom Reordering
-
Hey Team,
I’m encountering an issue with excluding standard posts from custom re-ordering. Despite using the following code, the order of some normal posts on the frontend still appears incorrect:
add_filter('pto/posts_orderby/ignore', 'theme_pto_posts_orderby', 10, 3);
function theme_pto_posts_orderby($ignore, $orderBy, $query) {
$post_type = isset($query->query_vars['post_type']) ? $query->query_vars['post_type'] : '';
if ( (is_string($post_type) && $post_type == 'post') ||
(is_array($post_type) && in_array('post', $post_type)) ) {
$ignore = true;
}
return $ignore;
}Could you help me identify what might be causing this issue?
Any insights would be greatly appreciated.Thanks a lot!
Judit
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.