Skip to:
Content
Pages
Categories
Search
Top
Bottom

How do I exclude a category from the front page?


  • master5o1
    Participant

    @master5o1

    How do I exclude a category from the recent topics front page?

    What I want is to have a ‘controversial’ category that users can post to but doesn’t show up on the front page listings of recent topics.

    Consider it like a trash category.

Viewing 17 replies - 1 through 17 (of 17 total)

  • zaerl
    Participant

    @zaerl

    With the word “category” you mean a parent forum?


    master5o1
    Participant

    @master5o1

    Yes, I mean parent forum, not a forum that has been check-boxed into being a ‘category.”


    zaerl
    Participant

    @zaerl

    So you must manually change the loop the you will find in the template file front-page.php.


    master5o1
    Participant

    @master5o1

    Still not sure how :|


    master5o1
    Participant

    @master5o1

    on index.php get_latest_topics(‘exclude=id_of_the_controversial_forum’);

    Ok, so I changed the line to be this:

    if ( $topics = get_latest_topics(‘exclude=8’, $page) ) {

    How do I make it exclude more than one forum?

    Say, don’t want forum game threads showing up, so I’d block 7 also…


    zaerl
    Participant

    @zaerl

    Try:

    if ( $topics = get_latest_topics('exclude=8,7', $page) )

    but I’m not sure that this will function.


    gerikg
    Member

    @gerikg

    I found this: http://phpdoc.ftwr.co.uk/bbpress/ is that helpful in finding an answer?


    master5o1
    Participant

    @master5o1

    That doesn’t work. :| (to making it exclude=7,8)


    master5o1
    Participant

    @master5o1

    get_latest_topics (line 61)

    void get_latest_topics ([ $args = null])

    $args

    So…what is $args?


    Xevo
    Participant

    @xevo

    Arguments, stuff you want to do with the function. It’s used all over wordpress/bbpress.

    Looked it up in a PHPXref and found that ‘exclude=7,8’ should work, try removing the $page and see what happens.


    master5o1
    Participant

    @master5o1

    Nahp.

    Whenever I do exclude=7,8 it just does it as

    exclude=7

    and then

    8

    It results as only showing from 8 (except for stickies).


    Xevo
    Participant

    @xevo

    Perhaps trying ‘exclude=-7,-8’?


    master5o1
    Participant

    @master5o1

    That seems illogical, but I will try.


    master5o1
    Participant

    @master5o1

    Strangely, it works. I suppose I can mark this resolved :D


    Xevo
    Participant

    @xevo

    The minus tells the script to remove the categories from the loop, without it, it tells the loop to focus on only those. It is logical when you think about it. :)


    master5o1
    Participant

    @master5o1

    Yeah, I agree with that. But does that mean it isn’t necessary for ‘exclude=’


    gerikg
    Member

    @gerikg

    Start a ticket with that…

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