Hey Guys,A 'lil help here
Well say we want to add different layouts for different authors.
For http://mysite.com/?author=1; i think wp will use author.php template.
But say i need a special author page template for author number 5
OR even different page templates for administrators,editors,contributors etc..
How do we do this?
By default, there's not a an option with authors as there is with categories, however, you should be able to do some kind of conditional statement and simply do an include. As far as templates for different roles, that would require some plugin type function to filter the role, and then do a similar type include.
And that's as far as I would be able to answer, perhaps someone else would be able to provide some code to do the filtering.
Well i'm pretty weak in coding guys.Thanx miklb
Anyone know how to put such an include? or a conditional statement to do this?.
I really think they should add such a feature in the upcoming versions of wp
Don't forget WP is still considered basically a "personal publishing tool" - and I'd put the emphasis on personal... so, everything beyond that is a bonus :)
@moshu.
I'm really glad its giving us more than just personal publishing tool.
I really think they should add such a feature in the upcoming versions of wp
Then make a ticket. :)
http://trac.wordpress.org/
Still anyone knows how to do this until then?
if ( is_author('bob') ) {
// do something, like load a custom stylesheet
} elseif ...
Err.Where do i add these guys?
Might want to take a look at Author_Templates.
Stepping_Into_Templates also gives some good info useful for getting your feet wet with WordPress templates.
Well Thanks a lot you guys .Till WP brings in the author template feature I am using this method to vary my author templates.
<?php if ( is_author(1) ) : ?>
<?php elseif ( is_author(2) ) : ?>
<?php elseif ( is_author(3) ) : ?>
<?php elseif ( is_author(4) ) : ?>
<?php else : ?>
<?php endif; ?>