Display only author's posts
-
I’m trying to make every post only available to their authors, so nobody else can see or edit them, expect for the site’s admin. And I finally got it thanks to the following code that I found on this site:
function posts_for_current_author($query) { global $pagenow; if( 'edit.php' != $pagenow || !$query->is_admin ) return $query; if( !current_user_can( 'manage_options' ) ) { global $user_ID; $query->set('author', $user_ID ); } return $query; } add_filter('pre_get_posts', 'posts_for_current_author');
The thing is that I can’t find out how to modify the posts count for every author, because it still shows the total amount of posts published on my site.
Any ideas? Thanks in advance ??
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Display only author's posts’ is closed to new replies.