我的网站有一个静态登录页,有按钮可以转到Cait的内容或Shannons的内容。每个作者的页面都会有自己的帖子,以及一个包含社交媒体流的部分。这两位作者的内容必须分开。目前,我正在使用标题中的条件标记来处理这个问题,但最终只剩下空白的作者页面。有什么想法可以纠正吗?
标题。php-
<!DOCTYPE html>
<html>
<head>
<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>
</head>
<body>
<div id="container">
<div id="header">
<div class="logo">
<h1><img src="img/caitlogo.png" alt="cait barker logo" /></h1>
</div><!-- end logo -->
<nav>
<ul>
<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>
</ul>
</nav><!-- end nav -->
<div class="social">
<ul>
<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>
</ul>
</div><!-- end social -->
</div><!-- end header -->
<div id="streams">
<div class="vlog-stream">
<?php
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\']");
}
?>
<p>vlog</p>
</div><!-- end vlog-stream -->
<div class="ootd-stream">
<?php
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();
the_post_thumbnail();
endwhile;
endif;
wp_reset_query();
]
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();
the_post_thumbnail();
endwhile;
endif;
wp_reset_query();
]
?>
<p>outfit of the day</p>
</div><!-- end ootd-stream -->
<div class="insta-stream">
<?php
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\']");
]
?>
<p>instagram</p>
</div><!-- end insta-stream -->
</div><!-- end streams -->
索引。php-
<?php echo get_header();;?>
<?php
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> Posted on <?php the_date(\'M-d-y\'); ?> <span style="font-family: amatic;">>></span> <?php the_tags(\'tags: \', \', \', \'<br />\'); ?></p><!-- end post-meta -->
</div><!-- end post -->
</div><!-- end preview -->
</div><!-- end blog -->
<?php get_footer(); ?>