The following url resolves to the category template:
http://localhost/author/myusername/?category_name=somecategory
I have a category-somecategory.php
template and just a generic author.php
template. Is there any way to make such a url use the author.php
template instead of the category-somecategory.php
? If not how can I filter on both category and author and force it to use the author template?
You could change the template loaded by hooking onto
template_include
, checking ifis_author
andis_category
are both set, then switch the template for inclusion to the author template instead.Give this a shot..
You can do any number of conditional checks here before modifying which template gets loaded.
WordPress has several template fetching functions available already, i’ve used one in the example, but here’s a list for quick reference…
Hope that helps..
Seems like this could be done with Custom Queries.