242 posts WordPress Theme Devoloper
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 5-6 years
  • Most Wanted Bounty Winner
  • Referred between 1 and 9 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+1 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
  • Has been a member for 4-5 years
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • United States
  • Has attended an Envato Live event
  • Author had a Free File of the Month
  • Envato Studio (Microlancer) Beta Tester
  • Contributed a Blog Post
  • Beta Tester
+6 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
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
  • Sold between 50 000 and 100 000 dollars
  • Won a Competition
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
  • Bought between 50 and 99 items
  • Denmark
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
  • Sold between 1 000 and 5 000 dollars
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
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
  • Sold between 50 000 and 100 000 dollars
  • Won a Competition
tonyc says

Yep, you are 100% correct on that

242 posts WordPress Theme Devoloper
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 5-6 years
  • Most Wanted Bounty Winner
  • Referred between 1 and 9 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+1 more
kayapati says

Thank you friends

122 posts
  • Bought between 50 and 99 items
  • Denmark
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
  • Sold between 1 000 and 5 000 dollars
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/

195 posts Aivah
  • Most Wanted Bounty Winner
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Referred between 1000 and 1999 users
  • Exclusive Author
  • Author had a File in an Envato Bundle
  • Envato Studio (Microlancer) Beta Tester
+4 more
AivahThemes says

Kayapati use the below code

<?php if ($_GET['activated']){ wp_redirect(admin_url("admin.php?page=theme_options.php")); } ?>
242 posts WordPress Theme Devoloper
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 5-6 years
  • Most Wanted Bounty Winner
  • Referred between 1 and 9 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+1 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.”

195 posts Aivah
  • Most Wanted Bounty Winner
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Referred between 1000 and 1999 users
  • Exclusive Author
  • Author had a File in an Envato Bundle
  • Envato Studio (Microlancer) Beta Tester
+4 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