Correct Post Count ( All | Published | Drafts | Pending | Trash ) for Custom Post Type when restricting to view own posts
You have to change: ‘post_type’ => ‘post’, To: ‘post_type’ => ‘your_custom_post_type_name’, And a all the reference to standard post. Also, you should add the filters only for main query or you can end up with issues in secondary queries. Bellow an example code for gallery custom post type. I was trying to debug the code … Read more