The MU forums have moved to WordPress.org

Limit front page to one category? (9 posts)

  1. kevvin
    Member
    Posted 15 years ago #

    Sorry if this has been posted elsewhere, I searched for about 90 minutes before I decided to just sign up and ask.

    I have an MU site with a few thousand blogs on it, using subdomains. I want to be able to add a new category for Blog #1, "Announcements", but I *don't* want posts in that category to show up on the main page - I just want people to be able to access it from the "Categories" menu in the sidebar.

    Can somebody help?

  2. BondageRadio
    Member
    Posted 15 years ago #

    Actually, yes... this is a code issue that is the same in WP and in WPMU... I believe the information you want would be in the codex regarding post content...

    If I'm not mistaken you can choose to include/exclude various catagories from inside the loop.

    since 2.5 the main wprdpress.org site has been a bit rearanged... can anyone else help find the exact call he would need before I go digging through the codex again?

  3. kevvin
    Member
    Posted 15 years ago #

    Hey, Bondage - thanks for the reply.

    I found this:

    http://codex.wordpress.org/The_Loop#Exclude_Posts_From_Some_Category

    But figuring out how to make it MU-friendly is making my brain hurt. Since every blog shares the same theme, I don't want to impact anybody else's stuff, I just want to add a linked category for posts to the MAIN BLOG page only.

    Using their example, could I do something like...
    if ($blog_id = 1) {
    if (!in_category('3') && is_home() ) continue;

    ..blah blah blah rest of code
    }

    ????

    I would love to test it, but since testing it would (as they say on Galactica) "frak" with a live site, I'm hesitant. However, the above seems to make sense. It's just where to insert it on index.php that has me confused.

  4. andrea_r
    Moderator
    Posted 15 years ago #

    Diable the theme for the main page sitewide, and enable it just for the main blog. then make all the edits you like. :)

  5. kevvin
    Member
    Posted 15 years ago #

    andrea_r - THANK you.

    Forgive the dumb question, but I assume that if I want to use the same theme for the rest of the site, I could put a duplicate copy of that theme folder up and use that instead?

  6. kevvin
    Member
    Posted 15 years ago #

    Tested that one myself, it works fine.

    One interesting thing, though - disabling the theme sitewide and then assigning the COPY through the "Edit" link on the admin page DIDN'T change the theme I was using. I had to edit wp_1_options manually in order for the change to actually take effect.

  7. andrea_r
    Moderator
    Posted 15 years ago #

    You have to have renamed the copied theme too. :)

  8. kevvin
    Member
    Posted 15 years ago #

    Yeah, did that before I FTP'd the new theme over. Couldn't figure out why, no matter how many times I tried, the new version wasn't showing (could tell by sourcing the page and looking for the CSS file...)

    Then went to the edit menu and saw that my changes didn't "take".

    Ah well, solved now, after the edit to wp_1_options.

    Could it be that I set a different prefix than "wp_" ? Is it possible that when I changed themes, something went to update "wp_1_options", which doesn't exist, thus my changes never got added in the DB?

  9. andrea_r
    Moderator
    Posted 15 years ago #

    Weird, I dunno. first I ever heard of that happening.

About this Topic