Well, instead of using a $_GET parameter you could store a initiate state in your options-table.
E.g.
$initialized = get_option('mytheme_initialized');
if ( (false === $initialized) && is_admin() && ($pagenow == 'themes.php') ) {
//this code only runs when the theme is first activated
update_option('mytheme_initialized', true);
}
Unfortunately the “register_activation”-hook is only available for plugins -> http://core.trac.wordpress.org/ticket/13602
Related Posts:
- When to use _e and __ for the translation?
- With WordPress themes, where do I store the images and files relatively?
- Should `get_template_directory_uri()` be escaped?
- How to Include SVG sprites icons into the body tag? [closed]
- Why doesn’t /2013/01/ properly return January’s archives in archive.php?
- Child Theme not loading parent CSS
- How to disable 3.1 “Admin Bar” via script for the admin user?
- How the WordPress sidebar works
- two tinyMCE editors in the same page
- How to Change CSS Variable value in Theme Customizer Live Preview
- Separated Comment from Post
- index.php is not loaded for single posts
- wp_head() not inserting the default stylesheet style.css
- Easy WordPress theme creation tutorial? [closed]
- How do I add a post to a menu
- WordPress Customizer Control with React
- File Security Check in wordpress in index.php of theme
- how to implement wp_is_mobile on themes?
- Where is definied the theme location for the main menu in a WordPress template?
- How to disable automatic colors in the Twenty Twenty theme?
- Check if user has enrolled in Sensei LMS Course on Lesson Page
- Is my approach to enqueue styles inefficient?
- Part of Menu Item Hidden on Header Menu
- Child theme style.css versioning
- Disable front-page.php template
- Gutenberg – editor-font-sizes in functions not working
- Same ACF on two different pages
- Customize the previous_post_link output
- How to use get_template_part instead of include_once?
- How to remove comment link title attribute?
- Should we use ob_start() in WordPress short code
- Menu item added in wp_nav_menu_items filter is never highlighted
- Default string not appearing want to translate
- Using a page as home, how do I prevent nav from setting both home and page links active?
- Warning: A non-numeric value encountered in theme functions.php
- How can I ping update-core.php with a script?
- “Add A Widget” button in the Customizer
- loading blank white screen of slide
- Child Theme’s style.css not loading in mobile browser
- Set parent theme language with custom .mo files
- Change template if tag selected
- Broken theme, template is missing
- WordPress page/blog incorporated into static website
- How to reverse engineer the Twenty Eleven background image uploader?
- Theme Development -> Specific Homepage
- Premium theme licensing of php called through AJAX
- WordPress Theme With Modified View
- Issue on Accessing To Ajax Enqeued File to Pass to URL for Ajax Call
- pass wordpress template directory into ajax url call
- jQuery from parent theme loaded with many other scripts in a single min.js file
- Javascript development in Custom Themes
- Custom jquery not code not working in wordpress
- Customize Option Framework
- Under theme folder, what’s sequence of action for index.php, page.php, single.php?
- Allow filtering of loops for all categories
- Getting white screen of death on category pages because of body_class() function
- Let user to upload multiple time
- get main URL from subdirectory with php
- Infinite loop when nesting have_posts()
- Is_single not working properly in genesis
- Developing WordPress site behind a static site
- Code showing in wordpress post titles around website
- register_theme_directory() sees custom themes directory, but blank frontend
- How to change parent permalink?
- how to call options on front end and add logo
- Jetpack Infinite Scroll Not Working
- After WP 4.6.1 Update , Blog page started giving 500 error
- Editable screenshot.png in a custom theme developed
- How to create multiple pages in a client theme?
- How to share posts (and plugins) between existing site and new, separate dev/test installation?
- Duplicate WordPress site to subdirectory but use same db?
- Menu order of parent menu from perspective of child menu
- Conditional loop based on current page
- Theme customizer live preview JS- Trying to bind to an html image url without luck
- wp_deregister_script was called incorrectly
- Theme options not displaying correctly after theme update
- Undefined index: debuging error for theme option template snippet
- Multiple Content Shortcodes
- Is it possible to customize the layout of Gallery Shortcode?
- Add the ability of changing background color of a theme [closed]
- How to use esc_attr__() function properly to translate a variable that contains string?
- What to do when child theme is out of date with parent theme
- Permalinks problem with custom theme
- Purchased Theme to Custom Made Theme? [closed]
- How to make website with many template that active [closed]
- Query for tag given slug
- Image Size wrong during upload
- How to make a multilingual wordpress site to be translated one-to-one without much effort and without using translate?
- Is there a way to have WordPress autodetect page templates in the page-templates directory and any sub-folders?
- Feeds are showing where Post archive page should be
- My wordpress site memory exhausted more than 1GB trying to debug with default
- Display first post on each page differently than the others
- Custom Theme functions.php – Using add_settings_field and input type=”file” to set custom logo
- Theme template file for a specific custom taxonomy
- How do I work with responsive images in WordPress? (img srcset/sizes)
- How can I use pre declared blocks in a php file?
- jQuery Snippet Not Working on WordPress Site [closed]
- WordPress Two Level Filters on Getting Custom Taxonomy Terms
- I want to resize post featured image without cropping image. How?
- Image and font support missing in editor when deploying theme remotely