Similar to the way you can select which version of single.php appears, depending on the category, is there anyway to select a different author.php, depending on the author ID?
Was thinking about using something similar to this, but adapting for author and author id…
Code:
<?php
$post = $wp_query->post;
if ( in_category('X') ) {
include(TEMPLATEPATH . '/single-b.php');
} else {
include(TEMPLATEPATH . '/single-a.php');
}
?>
any thoughts of how I could adapt this?
cheers
adam
(von: adamwork)
Hier noch 4 weitere Ergebnisse dieses Threads:
Re: Different author.php depending on author ID :: Reply by Joern
12. Jul. 2010 (von: Joern)
it's easier, similar to category-4.php you can use:author-{id}.php - If the author's ID were 4, WordPress would look for author-4.phpsee here:http://codex.wordpress.org/Author_Templates____________________you find me on Google+, Twitter and Facebook Weiterlesen →
Re: Different author.php depending on author ID :: Reply by adamwork
12. Jul. 2010 (von: adamwork)
Hi joernthanks for getting back, i'm slightly confused though.What should I put in my main author.php? Currently I have:Code:<?php if(isset($_GET['author_name'])) : $curauth = get_userdatabylogin($author_name); else : $curauth = get_userdata(intval($author)); endif; …
Re: Different author.php depending on author ID :: Reply by adamwork
12. Jul. 2010 (von: adamwork)
Sorry Joern, I've just re-read and think I understand now!! I basically just need to create different author.php files and call them:author-4.php and author-5.php etc etc... Weiterlesen →
Re: Different author.php depending on author ID :: Reply by Joern
12. Jul. 2010 (von: Joern)
right, no switch required!just try it with any author ID, a copy of your original author.php and something changed to see which file wordpress takes.____________________you find me on Google+, Twitter and Facebook Weiterlesen →