Redirect After Theme Activation

Posted on Leave a comment
5/5 - (185 votes)
If you have special instructions in your theme (eg. in your theme options page) that you’d like the user to see when they first activate the theme, you can use the following function to redirect them there:

if (is_admin() && isset($_GET['activated']) && $pagenow == "themes.php")
  wp_redirect('themes.php?page=themeoptions');

Pay special attention to the wp_redirect() function. Make sure to replace the themes.php?page=themeoptions with the URL of your page.

Where possible, stick to the main roads i.e. follow the native/established WordPress way of doing things.

Leave a Reply

Your email address will not be published. Required fields are marked *