skip to Main Content

I am wondering if anybody has an idea about how to make this possible.

1: User chose a website design from a gallery in my website.
2: Then, I create a hosting for my user and Install wordpress, but with the chosen theme.

I already have a module to autoinstall wordpress after provisioning the hosting. but this comes with the default theme.

I do not want to do this manually, the only idea I have is to create copies of WordPress installations with the selected theme, and then upload them via ftp to each user, but I would like to know if anybody has a better idea, I would really appreciate your comments.

I use WHMCS to activate the hosting in Cpanel, and I have a module to autoinstall wordpress.

Best regards

2

Answers


  1. There are several ways to achieve this. It really depends on your automation/workflow.

    You could invoke a small bash script that interacts with WP CLI.
    For example:

    wp theme activate mytheme
    

    Or you could update the database manually with:

    update_option('current_theme', 'my_theme');
    update_option('template', 'my_theme');
    update_option('stylesheet', 'my_theme');
    update_option('my_theme_options', $theme_options );
    

    Or via PHP:

    switch_theme( 'my_theme' );
    
    Login or Signup to reply.
  2. First you install wordpress normally by following basic rules said by wordpress.org or many third party websites.After wordpress installation login to your dashboard.You can find an Appearance option at the left side of the dashboard.When you hover your mouse point on that,you will get a Themes options.If you click on that Themes options it will open a new page.There you can find pre installed themes and active theme like Two Thousand Seventeen,Two Thousand Sixteen and Two Thousand Fifteen.These all are the pre installed themes will come by wordpress.You can activate the theme which you like.Hope this answer is helped you. If you want to learn more about how to install wordpress with predefined theme then Click Here.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search