WP Hive » Troubleshooting and How-To

Blog templates?

(6 posts)

  1. helene
    Member

    All my blogs are going to be very similar. It would be great if some of the initial setup, and even some of the basic content, could be there automatically when adding a new blog to the hive.

    For instance, is it possible for each new blog to have certain user roles already set up? Is it possible for each new blog to have some pages already there (the way new WordPress installations come with one post already posted)?

    Thanks very much!

    Posted 3 years ago #
  2. ikailo
    Developer

    It’s a little technical, but I think you could set up a site with all the content you want in the new installs, and then export (dump) the tables to create a ‘template set’ (but don’t include the two wphive tables in the export set). For each new blog you set up, make a few edits (find / replace) to the exported data, and then upload it to the database, basically doing a manual install.

    The values that change for each blog database table set are:

    • The unique prefix for the tables for the blog.
    • The siteurl (hostname / domain name) for each blog.

    So, to manually create a new blog through the database only:

    • Import a set of tables with a unique prefix and updated hostname.
    • Add an entry to the ‘wphive_hosts’ table with the unique prefix and the hostname.

    Don't forget to set up the domain on the webserver.

    Posted 3 years ago #
  3. helene
    Member

    I did this!  It was really, really easy!  I had no idea I could open a sql file in bbedit.  It was incredibly easy!!!!!!!

    Posted 3 years ago #
  4. wwday3
    Member

    I can see a real need eventually for a "cloning" script - something that would allow the capability of copying and pasting an existing site to another new site. Any thoughts about the best way to approach this?

    Posted 3 years ago #
  5. ikailo
    Developer

    I don't think that would be to difficult to do. It's possible to copy a table, so it's just a matter of going through each table on the template site, making a copy with a new table name (using the new prefix), and then setting a few things in the options table to reference the new domain name...

    Posted 3 years ago #
  6. wwday3
    Member

    Thanks for the hint. I think I'll practice creating a script using this suggestion. The copy/insert should be pretty easy. I suppose it's just an insert for the WP-Hive tables as well. Is there a nice simple way to "prompt" for a value? Like, once the script starts up, have it ask for a new prefix?

    Posted 3 years ago #

RSS feed for this topic

Reply

You must log in to post.