0

I have a large MultiSite network, and each page is designed a bit differently. I'm looking to write some custom code to automate the setup of a new blog as much as I can.

Things I'm looking to do for every new blog:

  • Activate a theme
  • Create some new pages (contact, about us, etc.)
  • Add and configure some widgets
  • Etc.

I'm completely willing (even eager) to write custom code to make this automation happen. However, I'd like to leverage as much existing code as possible. What recommendations do you have in order to make this happen?

I know that I can use wp_insert_post() to insert posts and pages, but how should I go about activating a theme, enabling widgets, etc.?

1

You'll want to hook into wpmu_new_blog. You can see the args you can pass it here (no codex right now...). That last $meta arg can take a lot of different settings.

You also might look into the WPMU New Blog Defaults. It doesn't seem to do everything you want, but it might at least contain some good examples for how to use that hook.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.