The MU forums have moved to

Shared Categories - or Default ones for user blogs (5 posts)

  1. LynneLiL
    Posted 17 years ago #

    Hi, I know, I'm a pain in the butt.

    I've been reading about global categories on the forum (tag clouds, all that fun). I sorta get how they work and what they are.

    But I need kind of the opposite. Here's the scenario:

    I want there to be common categories across all new blogs that users make. Specifically, there's two parent categories I want to show up in every new install, and a bunch of subcategories in one of the parents.

    So, for all new blogs, the category "town-related" should show up, and for that person, they will, or we will, add the town the blogger will commonly (almost exclusively) be writing about (and probably make it default). Also, another category, say "farm-related" parent category will have some preset subcategories...for argument's sake, "Pigs", "Chickens", and "Horses". (No, those aren't the real categories/subcategories.)

    Then, from the main blog, I plan to RSS-gather everything which uses the "town-related" category on one page, and iterate everything "farm-related" on a second page, making it easy for readers to see everything in each category without viewing all the blogs. The front page may just RSS everything together but just titles and a very short exerpt, if that. Not sure. But I know I want a "town-related" and a "farm-related" field.

  2. lunabyte
    Posted 17 years ago #

    You'd either have to hard code the additional cats into the queries that get run when a blog is created, or look and see if there is an action hook in that area.

    If there's an action hook, you can add an mu-plugin that adds the additional cats through the action hook.

    I can't remember off the top of my head if there is one in there or not.

  3. LynneLiL
    Posted 17 years ago #

    Probably beyond my skills, I imagine. I can code PHP, but only marginally. :) Mostly my WP experience is tweaking themes and stuff.

    Thanks! If anyone else has heard of this, or thinks it's a good idea, I'd be interested.

  4. foolfillment
    Posted 16 years ago #

    I'd like a way of doing this. I've trying to work out what file does what but can't find what populates the database when a new blog is created.

    Does anyone have any pointers, I know that wp-settings.php sets up the tables and that index-install.php sets up the site- tables but that's as far as I've got.

    The main capability I want is preset categories for every new blog.

  5. foolfillment
    Posted 16 years ago #

    I've tracked it down to wpmu-functions.php and added in the categories I wanted. It took a lot of trawling through all the files, is there any where in the support docs that explains what each file does? That would have been helpful.

About this Topic

  • Started 17 years ago by LynneLiL
  • Latest reply from foolfillment