331 posts WordPress Theme Devoloper
  • 6 Years of Membership
  • Affiliate Level 1
  • Author Level 9
  • Collector Level 2
+11 more
kayapati
says

Hi mates

How to activate my theme options settings page immediately after theme is activated?

I have seen few themes are working like this.

Can any one explain how to do it?

1950 posts Do the Needful
  • Weekly Top Seller
  • Author Level 8
  • Elite Author
  • 5 Years of Membership
+12 more
JamiGibbs
says
Hi mates

How to activate my theme options settings page immediately after theme is activated?

I have seen few themes are working like this.

Can any one explain how to do it?

Do you mean that you purchased a theme and don’t see the options settings? If so:

Have you activated the theme from the “Appearance > Themes” menu?

Then your theme options settings should automatically appear in the WP admin menu on the left of your screen. Sometimes the theme options will have its own standalone link, other times it will be under the “Appearance” dropdown.

If you mean you’re developing a theme and trying to create a theme options panel for it then I suggest reading this tutorial:

http://net.tutsplus.com/tutorials/wordpress/how-to-create-a-better-wordpress-options-panel/

Specifically the line of code where it adds the theme options to your WP admin menu is:

add_menu_page($themename, $themename, 'administrator', basename(__FILE__), 'mytheme_admin');  
# }  

You can read about adding administration menus in Wordpress here:

http://codex.wordpress.org/Adding_Administration_Menus

164 posts
  • 7 Years of Membership
  • Affiliate Level 2
  • Author Level 6
  • Collector Level 2
+5 more
tonyc
says

I think he wants to redirect users to the theme options page when they activate his theme.

You can use the “after_setup_theme” hook introduced in WordPress 3.0 to execute some javascript to redirect the user to the theme settings page.

More info on the hook here:

http://adambrown.info/p/wp_hooks/hook/after_setup_theme?version=3.0&file=wp-settings.php

122 posts
  • 6 Years of Membership
  • Affiliate Level 2
  • Author Level 3
  • Collector Level 3
+2 more
jayjdk
says

@tonyc,

The “switch_theme” hook would be better as it only runs when the user switch theme. “after_setup_theme” runs on every page (http://codex.wordpress.org/Plugin_API/Action_Reference )

164 posts
  • 7 Years of Membership
  • Affiliate Level 2
  • Author Level 6
  • Collector Level 2
+5 more
tonyc
says

Yep, you are 100% correct on that

331 posts WordPress Theme Devoloper
  • 6 Years of Membership
  • Affiliate Level 1
  • Author Level 9
  • Collector Level 2
+11 more
kayapati
says

Thank you friends

122 posts
  • 6 Years of Membership
  • Affiliate Level 2
  • Author Level 3
  • Collector Level 3
+2 more
jayjdk
says

If it doesn’t work, try this

global $pagenow;

if ( is_admin() && 'themes.php' == $pagenow && isset( $_GET['activated'] ) ) {

}

http://foolswisdom.com/wp-activate-theme-actio/

211 posts Aivah
  • Top Monthly Author
  • Trendsetter
  • Weekly Top Seller
  • Elite Author
+14 more
AivahThemes
says

Kayapati use the below code

<?php if ($_GET['activated']){ wp_redirect(admin_url("admin.php?page=theme_options.php")); } ?>
331 posts WordPress Theme Devoloper
  • 6 Years of Membership
  • Affiliate Level 1
  • Author Level 9
  • Collector Level 2
+11 more
kayapati
says
Kayapati use the below code <?php if ($_GET['activated']){ wp_redirect(admin_url("admin.php?page=theme_options.php")); } ?>

Faheem

I get the bellow error when I use the above code in function.php

can you tell me where I need to place the above code?

The error I get:

“You do not have sufficient permissions to access this page.”

211 posts Aivah
  • Top Monthly Author
  • Trendsetter
  • Weekly Top Seller
  • Elite Author
+14 more
AivahThemes
says

I will drop you an email with the code direction on how to make this activated.

by
by
by
by
by
by