你能解释一下你想做得更好一点的是什么吗。您想从某些用户筛选某些类别,还是从所有用户筛选某些类别?
编辑:这里有一些我在上面找到的项目。
现在我还没有试着看看这是否有效,因为我目前没有一个buddypress站点可以处理,要想得到一个测试站点并了解您的设置需要很多时间
最难的是下载这个插件Front Page Category Filter 并从中提取代码根据这句话(found here):就像你在WordPress中使用“循环”来循环帖子一样,BuddyPress中的每种内容类型都有自己的自定义循环。
通过在模板中使用这些循环,您可以输出任何类型的信息,并真正自定义内容在BuddyPress主题中的显示方式。
默认BuddyPress主题(/wp content/themes/bp default)使用BuddyPress中可用的所有自定义循环。它提供了一个在实际使用情况中使用循环的好例子。
您可以在BuddyPress主题中使用WordPress自定义循环,只要它使用它们。
You can find the WordPress loop\'s codex page by clicking here 和the one you specifically need by click here
以下是您需要的代码:
以下行<?php if ( is_home() ) {
帮助buddypress确定这只需要在主页上进行。
<?php if ( is_home() ) { query_posts($query_string . \'&cat=-3,-8\');} ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="post">
<!-- Display the Title as a link to the Post\'s permalink. -->
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. -->
<small><?php the_time(\'F jS, Y\') ?> by <?php the_author_posts_link() ?></small>
<div class="entry">
<?php the_content(); ?>
</div>
<p class="postmetadata">Posted in <?php the_category(\', \'); ?></p>
</div> <!-- closes the first div box -->
<?php endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
<?php endif; ?>