activation hook for a theme in wordpress

I didn’t find any such type of hook.

A simple workaround is:
if ( is_admin() && isset($_GET[‘activated’] ) && $pagenow == “themes.php” ) {
// do your stuff
}

Advertisements

About Kapil Chugh

In love with PHP and tweaking WordPress. Hungry for Open Source and new technologies. Honest. God-fearing. Happiest when solving problems.
This entry was posted in WordPress and tagged , , . Bookmark the permalink.

8 Responses to activation hook for a theme in wordpress

  1. It’s the best time to make some plans for the future and it is
    time to be happy. I’ve read this post and if I could I want to
    suggest you some interesting things or suggestions. Maybe you could write next articles referring to this article.

    I want to read even more things about it!

  2. Damian says:

    Hi would you mind stating which blog platform you’re working with? I’m planning to start my own blog in the near future
    but I’m having a tough time deciding between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your design and style seems different then most blogs and I’m looking for something unique.
    P.S Apologies for being off-topic but I had to ask!

  3. Oxitamin says:

    This post will assist the internet visitors for building
    up new web site or even a weblog from start to end.

  4. Green Detox says:

    I’m not that much of a online reader to be honest but your sites really nice,
    keep it up! I’ll go ahead and bookmark your site to come back down the road. Cheers

  5. It is truly a great and useful piece of information.
    I’m glad that you simply shared this useful information with us. Please stay us up to date like this. Thank you for sharing.

  6. George says:

    Hello There. I found your blog using msn. This is a really well written article.

    I will make sure to bookmark it and come back to read more of
    your useful information. Thanks for the post.

    I will certainly return.

  7. Hi there! This article could not be written much better!
    Reading through this article reminds me of my previous roommate!
    He constantly kept talking about this. I’ll send this information to him. Fairly certain he will have a very good read. Many thanks for sharing!

  8. I was looking for activation/deactivation hook for themes. Yours was the best approach but it is a bit unreliable as admin can refresh the page after activating theme and activation code can run multiple times. I have written a code which provides a reliable activation/deactivation theme hooks. Please check it out and let me know what you guys think!

    http://www.krishnakantsharma.com/2011/01/activationdeactivation-hook-for-wordpress-theme/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s