No related posts is showing when exclude a category
-
Hello, I already commented on this issue on a thread but later discovered that it is resolved so just to be sure that the plugin support will see my issue here it is:
I want to exclude posts having only 1 specific category from showing in related posts. for example, if the post has categories “a” and “b”, I want to exclude category “a” from showing so I used this code according to a link mentioned by the support:
add_filter(‘related_post_query_args’,’related_post_query_args_20200126′); function related_post_query_args_20200126($args) { // exclude categories $args[‘category__not_in’] = array(3748);//3748 is id for category b return $args; }
But the problem is no related posts are showing even if the post has a category “b”.
Any help would be appreciated!
Thank you!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘No related posts is showing when exclude a category’ is closed to new replies.