The MU forums have moved to WordPress.org

Pre Populating Database (6 posts)

  1. ryanfitzer
    Member
    Posted 17 years ago #

    Is there a way to to add pages, categories and posts so when a new user signs up they will have all of the same pages, categories and posts to begin with? I'm setting up WP MU with a very specific template and would like to eliminate any errors that intricate user setups would produce

  2. drmike
    Member
    Posted 17 years ago #

    The default theme has been discussed a couple of times before here on the forums. Open up /wp-admin/upgrade-schema.php for editing, find the following lines:

    add_option('template', 'default');
    add_option('stylesheet', 'default');

    And change the 'default' to the name of the subdirectory of the theme you want as your new default.

    I added it to the wiki by the way.

    To add in your pages, categories, and posts, ytou'll need to edit your wp-includes/wpmu-functions.php file and add in the MySQL statements. Do a search for 'Default category' and you'll see how it's done.

    Hope this helps,
    -drmike

  3. ryanfitzer
    Member
    Posted 17 years ago #

    Thanks so much drmike. I'll check out the wiki. This is a big help.

  4. ryanfitzer
    Member
    Posted 17 years ago #

    Gave it a try (unsuccessfully) and I have a couple questions.

    Do I put the new page queries directly under the original page ("About" page) queries and before "// Flush rules to pick up the new page"?

    Also, do I also need to use the upgrade link in the site admin to make this take effect?

  5. ryanfitzer
    Member
    Posted 17 years ago #

    I did update the values in the "post2cat" to "VALUES (3, 3, 1)". The "about" page has the values of "VALUES (2, 2, 1)".

  6. ryanfitzer
    Member
    Posted 17 years ago #

    Ok, scratch the last two posts. I had it right but when I saved the wpmu-functions.php file it was going on my local machine instead of the server. Thanks so much again for the great help.

About this Topic

  • Started 17 years ago by ryanfitzer
  • Latest reply from ryanfitzer