I have two authors pages, one displays about 5 posts. Then I’m trying to setup another page that will be all of their posts. I have created a template called moreauthorposts.php and I’m trying to pass the author variable to this page. Problem is if i pass domain.com/more-author-posts?author=johndoe it gets stripped out. How can I retrieve this value? Is this even possible in wordpress? I know WP Rewrite is jacking my URL structure somehow I’m just not sure.
I’ve tried:
get_query_var('author')
and tried reading this but didn’t have any luck:
http://codex.wordpress.org/Query_Overview
Suggestions?
Thanks.
I’m almost sure that
author
is built-in, so use something likeauthor_more
. You will need to add that var toquery_vars
first. Example:Then on your
more-author-posts.php
template call it like this:Update
This works in the following URl example/use case:
But if you want to use this as fancy URl, you need to add a rewrite rule:
Now you can use it like this