I’m sorry if this question is already been done, but I couldn’t solve my problem after reading similar questions.
I would like to have customized author pages, in which each author can write text and insert images directly from the editor of wordpress.
Under the written page author, you should see the latest articles written by him (style blog).
I was able to create a template that works perfectly. The problem is that with this code I should create 20 different templates (one for each author) changing the id.
How can I tell wordpress to include the latest articles written by the author of each page?
Here’s the code I used in my page template:
<?php query_posts('author=4'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
As mentioned by @mridul-aggarwal WordPress supports author pages with the
author.php
template (Author_Template).If you are setting up a custom template you will need some method of letting the template discover which user is supposed to be displayed, this is usually done via a POST/GET request or in the URI
http://example.com/path/to/user/username
which you can then detect using PHP.