Restrict a user to view other post except he created

To restrict a specific user to view other post except he created need to add the below code to your theme function file. Put the below code to function.php and you are done. function posts_for_current_author($query) {         global $pagenow;     if( ‘edit.php’ != $pagenow || !$query->is_admin )         …