【发布时间】:2017-01-08 11:33:35
【问题描述】:
我正在寻找一种从作者页面中排除类别的方法。我有一个作者撰写的类别,但是当您导航到作者存档页面时,我希望该类别在显示该作者的所有其他帖子时不显示。
以下是构成我的自定义作者页面的代码
<?php get_header(); ?>
<?php get_header(); ?>
<div class="mh-wrapper clearfix">
<div id="main-content" class="mh-content">
<?php
mh_before_page_content();
mh_magazine_lite_page_title();
?>
<p><img style="border-bottom:3px solid black;" src="http://chaseonair.com/wp-content/themes/theme-andrews/images/chase-blog-header.jpg"></p>
<?php
if (category_description()) { ?>
<?php
}
if (is_author()) {
mh_magazine_lite_author_box();
}
if (have_posts()) {
while (have_posts()) : the_post();
get_template_part('content', 'loop');
endwhile;
mh_magazine_lite_pagination();
} else {
get_template_part('content', 'none');
} ?>
</div>
<?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>
我在网上找了这个
query_posts($query_string . "&cat=-1");
我尝试过使用它,但是它要么会导致错误,要么当我导航到旧帖子时,它只会再次显示前 5 个帖子。
任何帮助将不胜感激。
【问题讨论】:
标签: wordpress loops posts author