Forums

[resolved] Custom Author Templates (11 posts)

  1. JakeUP
    Member
    Posted 2 years ago #

    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?

  2. miklb
    Forum Concierge
    Posted 2 years ago #

    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.

  3. JakeUP
    Member
    Posted 2 years ago #

    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

  4. moshu
    Member
    Posted 2 years ago #

    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 :)

  5. JakeUP
    Member
    Posted 2 years ago #

    @moshu.
    I'm really glad its giving us more than just personal publishing tool.

  6. Viper007Bond
    Member
    Posted 2 years ago #

    I really think they should add such a feature in the upcoming versions of wp

    Then make a ticket. :)

    http://trac.wordpress.org/

  7. JakeUP
    Member
    Posted 2 years ago #

    Still anyone knows how to do this until then?

  8. Viper007Bond
    Member
    Posted 2 years ago #

    if ( is_author('bob') ) {
    // do something, like load a custom stylesheet
    } elseif ...

  9. JakeUP
    Member
    Posted 2 years ago #

    Err.Where do i add these guys?

  10. MichaelH
    moderator
    Posted 2 years ago #

    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.

  11. JakeUP
    Member
    Posted 2 years ago #

    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; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic