Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Posts by specific author name

Display posts by author, using author ‘user_nicename’.

// WP_Query arguments
$args = array (
	'post_type'              => array( 'post' ),
	'author_name'            => 'rami',
	'order'                  => 'DESC',
	'orderby'                => 'date',
);

// The Query
$query = new WP_Query( $args );