So, I want to create pages automatically on theme activation. This seems kinda easy with wp_insert_post().

The problem is: I need to select only certain pages to be created. Is there a way to do this? (thought of a dialog box with checkboxes or something like that, but I have no clue how to do this)

  • 2
    I don't think you can add a UI step to theme activation like that. Maybe you could add a settings page that can create those pages and redirect to it after activation? But then if the customizer is used to activate the theme it wouldn't make sense, and it'd be a terrible experience as the user isn't expecting it. What problem are you trying to solve by doing this? – Tom J Nowell Mar 22 '18 at 23:08
  • I will be activating the theme, so the user experience in this case is not so relevant. This is a theme for a very specific type of business, which have a lot of pages with different forms. But each client will have a certain group of these pages (still a lot). So I want to speed up the setup process for me. Using the customizer seems a good idea actually... Thanks for the input! (: – brumilk Mar 23 '18 at 13:30

Your Answer

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

Browse other questions tagged or ask your own question.