I am creating a profile page in wordpress for each of the authors creating posts. Each page title will be equal to the authors name.
On this page I want to be able to display ‘the_content’ which will be some images and a bio of the author followed by the 6 latest posts from them.
What I want to do is create a query that displays the posts where author_name = the_title.
At the moment I have this which is only displaying the author that I specify (eg. John Smith).
$author_posts = new WP_Query();
$author_posts->query( array( 'author_name' => 'John Smith', 'posts_per_page' => 6) );
while ($author_posts->have_posts()) : $author_posts->the_post();
//DISPLAY POST CONTENT
endwhile;
you can use get_the_title() function.
See this link to learn more about get_the_title() function.
http://codex.wordpress.org/Function_Reference/get_the_title