• So im trying to set up my single post template to display a different template depending on what author is posting. Is that possible? Each author wants to have there own custom page design when they create an article. However the main page will show every post normally. Once you click a post you like, the template changes depending on the name of the author. Possible? Thoughts?

Viewing 1 replies (of 1 total)
  • if it just css then you could load a different style sheet according to author:

    <?php if(is_single()) { $author_id=$post->post_author;
    if($author_id==1) { echo '<link rel="stylesheet" href="'.bloginfo('template_url').'/style_author1.css" type="text/css" media="screen" />'; };
    etc ; } ?>

    or you could turn single.php into a hub:

    <?php
    /* single.php author hub */
    $author_id=$post->post_author;
    if($author_id==1) { include (TEMPLATEPATH . '/single_author1.php'); }
    if($author_id==2) { include (TEMPLATEPATH . '/single_author2.php'); }
    ?>
    <?php // normal single.php could follow ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Heres a fun one! =)’ is closed to new replies.