Skip to:
Content
Pages
Categories
Search
Top
Bottom

Help with excluding hidden, spam, and closed topics from the front page.

  • @aravoth

    Participant

    Hey everyone, I’m having a bit of trouble with my query. I’m display forum posts on the home page of my wordpress site so they kind of look a bit like a blog post. What I’m having a hard time figuring out is, how can I exclude spam, hidden, and closed topics from veiw on that page.

    Basically, I only want to show open topics on the home page, the part o the code in question is…

    $bbp_loop_args = array(
    'post_type' => bbp_get_topic_post_type(),
    'orderby' => 'date',
    'order' => 'DESC',
    'post__not_in' => bbp_get_super_stickies(),
    'posts_per_page' => 10,

    );

    if ( bbp_has_topics( $bbp_loop_args ) ) :

    if ( bbp_topics() ) : bbp_the_topic();

    global $more;
    $more = 0;

    get_template_part( 'content', get_post_format() );

    echo '<ol class="other-recent-posts">';

    endif;
    endif;

    I’m able to exclude super-stickies easily enough, but excluding hidden, spam, and closed topics is eluding me.

    Anyone out there have any Ideas?

Viewing 1 replies (of 1 total)
  • @aravoth

    Participant

    this seems so simple, like I should just be able to use

    ‘post__not_in’ =>

    as an array, and include bbp_get_super_stickies() and bbp_get_topic_closed_id

    or something like that.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar