My site has a static landing page with buttons to go to Cait's content or Shannons's content. Each author's page will feature their own posts, as well as a section with their social media streams. It is vital that these two author's content is kept separate. Currently, I'm using conditional tags in the header to take care of this but I've ended up with nothing but blank author pages. Any ideas how I can rectify?


<!DOCTYPE html>
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <meta name="generator" content="Wordpress <?php bloginfo('version'); ?>" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title><?php bloginfo('name'); ?> <?php wp_title(); ?></title>
    <link rel="pingback" href="<?php bloginfo('pingback url'); ?>" />
    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" />
    <link rel="shortcut icon" href="<?php bloginfo('stylesheet_directory'); ?>/favicon.ico" />
    <?php wp_head(); ?>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>


<div id="container">
    <div id="header">
        <div class="logo">
            <h1><img src="img/caitlogo.png" alt="cait barker logo" /></h1>
        </div><!-- end logo -->
                <li><a href="#">outfit of the day</a></li>
                <li><a href="#">vlog</a></li>
                <li><a href="#">features</a></li>
                <li><a href="#">diy</a></li>
                <li><a href="#">contact</a></li>
        </nav><!-- end nav -->
        <div class="social">
                <li><a href="http://web.stagram.com/n/caitbarkerr/"><img src="img/instagram.png" alt="cait barker instagram" /></a></li>
                <li><a href="http://www.youtube.com/user/caitbarker"><img src="img/youtube.png" alt="cait barker youtube" /></a></li>
                <li><a href="http://www.facebook.com/CaitShannonBarker"><img src="img/facebook.png" alt="cait barker facebook" /></a></li>
                <li><a href="https://twitter.com/caitbarkerr"><img src="img/twitter.png" alt="cait barker twitter" /></a></li>
                <li><a href="#"><img src="img/pinterest.png" alt="cait barker pinterest" /></a></li>
        </div><!-- end social -->
    </div><!-- end header -->

    <div id="streams">
        <div class="vlog-stream">
                if (is_author(cait barker)) {
                echo do_shortcode("[ix_show_latest_yt ytid='caitbarker' width='280' height='170' autoplay='off' count_of_videos='1']");
                if (is_author(shannon barker)) {
                echo do_shortcode("[ix_show_latest_yt ytid='shannonbarkerr' width='280' height='170' autoplay='off' count_of_videos='1']");
        </div><!-- end vlog-stream -->
        <div class="ootd-stream">
                if (is_author(cait barker)) {
                $new_query = new WP_Query( 'cat=your_category_id&showposts=2' );
                if( $new_query->have_posts() ): while( $new_query->have_posts ): $new_query->the_post();


                if (is_author(shannon barker)) {
                $new_query = new WP_Query( 'cat=your_category_id&showposts=10' );
                if( $new_query->have_posts() ): while( $new_query->have_posts ): $new_query->the_post();


            <p>outfit of the day</p>
        </div><!-- end ootd-stream -->
        <div class="insta-stream">
                if (is_author(cait barker)) {
                echo do_shortcode("[instapress userid='caitbarkerr' piccount='6' size='73px']");
                if (is_author(shannon barker)) {
                echo do_shortcode("[instapress userid='shannonbarkerr' piccount='6' size='73px']");
        </div><!-- end insta-stream -->
    </div><!-- end streams -->


<?php echo get_header();;?>
    if (is_author(cait barker)) {
    echo get_sidebar('cait');;
    if (is_author(shannon barker)) {
    echo get_sidebar('shannon');;

<div id="blog">
    <div class="preview">
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
        <div class="post-image">
            <?php echo ravs_get_custom_image( get_post_thumbnail_id () ); ?>
        </div><!-- end post-image -->
        <div class="post">
            <h2><?php the_title() ;?></h2>
            <span class="post-preview">
                <?php the_excerpt('read more...'); ?>
                <?php endwhile; else: ?>

                    <p>Sorry, no posts to list</p>

                <?php endif; ?>
            </span><!-- end post-preivew -->
            <p class="post-meta"><span style="font-family: amatic;">>></span>&nbsp;Posted on <?php the_date('M-d-y'); ?>&nbsp;<span style="font-family: amatic;">>></span>&nbsp;<?php the_tags('tags: ', ', ', '<br />'); ?></p><!-- end post-meta -->
        </div><!-- end post -->
    </div><!-- end preview -->
</div><!-- end blog -->

<?php get_footer(); ?>

2 Answers 2


As i see your code in header.php and index.php looking messy (because of many if conditions). If i'm understanding your problem then i do it like this

  1. create separate author.php for both authors their name like author-cait.php and author-shannons.php
  2. Give link like http://www.yousite.com/author/cait/ to button on static landing page.When user click on this,it takes him to author's specific author.php if exist
  3. create custom header.php for both authors name like header-cait.php and header-shannons.php
  4. create custom sidebar.php for both authors name like sidebar-cait.php and sidebar-shannons.php
  5. complete your code in author specific author.php for example author-cait.php contain only cait's conditon,header and sidebar.

It makes your code looking beatiful,manageable, save from overloding of if conditions.

  • Glad to be of help.This is my fist Bounty May 29, 2013 at 20:52

You don't declare two post index pages, not any way that I am aware of anyway. And if there is a way, I still think what follows is the better solution, given your other conditions.

I guess you could hook to template_redirect and load different templates based on the author but the neater solution, and the one I'd recommend, would be to create a new post type for each author. Each type, and hence each author, would have its own index page and you could use the built in templating system to format the pages.

The two authors could share tags and categories, you could create new taxonomies for each author and keep those separated, or do both-- share some and keep others distinct.

You could also create sidebars specific to the post type, and hence specific to the authors.

I think that covers the issues you mentioned.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.