There is no such thing as “theme activation”. Using the customizer you can change settings for any theme on the server, whether it is “active” or not, but at that context the theme will be active and if your code will not work correctly in that context users might be upset.
If you need to build a DB for your theme, just store a version indication, and use one of the available hooks to perform DB upgrade when there is a version mismatch between what the current version expect to find, and what is actually there. But be careful, judging from your other question, you want to create front end posts, and that should be done only when the user specifically initiates the action.
Related Posts:
- The the_post_thumbnail without srcset?
- after_setup_theme always runs
- Using classes instead of global functions in functions.php
- WordPress API Menu/Submenu Order
- How to move page template files like page-{slug}.php to a sub-directory?
- What WP folder can I use to write files to?
- Are the WordPress Core CSS styles really all nessesary?
- Why I can’t add a CSS style in this WordPress theme?
- Setting multiple default background images?
- How to make a theme with more than one CSS file?
- register_sidebar ignores ‘id’ and ‘class’
- Display a different theme for not logged-in users
- Best practice (forward compatibility) for theme options
- Add colors to existing color palette without replacing it
- Single Page WordPress Theme – Using page templates
- Select menu on browser resize
- Can I upload WordPress-react theme in Wp theme repository
- Returning Variables back into a template
- new theme permissions don’t allow me to edit
- Which theme foundry has clean coded themes, where code is poetry [closed]
- What page should I use for a contact form?
- Retrieve data using wpdb to use for customizer controls
- How can a Theme Contain no Header File or Footer File?
- Cannot get full thumbnail size using the_post_thumbnail
- Version control for both Vagrant config and themes being developed [closed]
- Is there a way to activate different theme for specified users? [closed]
- Some translations do not work in my template class
- WordPress not registering Theme Customization Section
- How to remove a file included in parent theme with locate_template() via child theme?
- qTranslate with my own theme and settings
- Stylesheet not linking
- How to control layout of posts on page?
- Override template file i subfolders
- Theme Development for WordPress Multisite Installation
- How to add infinite scroll?
- Include Parent functions.php in Child Theme functions.php
- create category on theme setup
- Change locale by detecting viewer’s browser language setting and let them choose prefered language after
- Why is it needed to enqueue parent stylesheet in child theme?
- WordPress Unite Theme: Footer isn’t sticking [closed]
- WordPress get_template_part() function not working
- Where am I doing wrong in my theme menu?
- How can my theme allow users to take advantage of advanced html tags in posts
- How to enqueue javascript for WP Customize options sidebar?
- WordPress 500 Internal server error when activating custom theme [closed]
- correct tags for validating input types
- What is the meaning of WordPress’s recommended css classes and where are they applied?
- Renaming a theme so it aids SEO and the theme used is hidden
- WordPress 3.8 Backend Admin Color Scheme add more scheme how to do?
- Theme thumbnail in dashboard
- How to change the theme directory uri for localhost?
- Will my site get messed up when the wordpress theme updates if I edited the html code in the editor to change footer?
- How to correctly enqueue the parent and child theme stylesheets in the creation of a child theme? [duplicate]
- Managing WordPress Theme
- featured content: which area does this cover [closed]
- Which cache is kicking
- What $handle does WordPress use for a theme’s implicit style.css?
- How to track a users last visited page?
- In a Gallery with limited image posts, how do I not limit images on single post?
- LESS not working in WordPress [closed]
- How to add custom page elements to the WYSIWYG editor?
- Why I obtain different visualization when I run the website on my local machine and on remote server?
- How to use the _S framework
- help needed for suit designing tool
- Open portfolio image in light box
- Let visitors show/hide a type of content
- Best practice for implementing a blog page / section in wp_menu_nav()
- How to modify theme content in Thematic?
- how to add a badge on product based on filter?
- how to create/register menu items that can be added to menus later
- Why nav_menu_css_class doesn’t work with apply_filters?
- WordPress and Semantic UI
- Customizer API Multi Sections in single Panel
- WordPress theme options checkbox default checked state
- Theme does not allow shortcodes
- Text widget is placing everything side by side. I want to post it above
- What is an alternative to not using child theme to customize a WordPress theme?
- How to show some of category in wordpress
- Creating a theme just to deploy a single page
- Menu names not getting translated
- How to generate a rtl.css file for themes?
- Get property of non-object on theme activation
- change wordpress website logo url [duplicate]
- wp_editor some functionality not working on custom theme
- Update modified Shopify third-party theme [closed]
- hide/show a div in wordpress
- Providing updates to your WordPress theme
- One-Page WordPress Template
- Weird ‘theme update’ error [duplicate]
- How one category can have different fields?
- How do child themes work?
- Fail to install theme on development copy of WordPress on Webmatrix
- How to prevent XSS attack in wordpress theme?
- Featured Image Module Randomly Disappears
- adding navigation to genesis themes
- Show post thumbnail only if it exists using timthumb
- Getting all months in one year WordPress Archive
- .submenu class missing in output from wp_nav_menu
- What is the point of using the front-page.php template? [closed]
- Is child-theme required when modyfing “Appearence > Editor”?