In functions.php you can create “your_set_tables_function()” and then hook it in the “after_switch_theme” hook.
Example:
add_action("after_switch_theme", "your_set_tables_function");
Related Posts:
- Using the same database on another Subdomain
- Opinions and recommendations on the best barebones base theme [closed]
- Customizing a WordPress theme without changing it?
- How to Link External jQuery/Javascript files with WordPress
- Custom Taxonomy-specific JavaScript
- Any official way to create an admin theme?
- Splitting an Evolving Site into Multiple Sites, or Maintaining as One Site?
- Building useful features into your theme
- Multisite: setting theme and options when a new blog is created
- Editing theme files and access to the Code pages only to super-admin?
- Change Default Image HTML
- How to delete default themes
- Extra User Profile Field Upload File / Image
- Edit raw HTML of the landing page
- Problem : deletion failed, the theme requested does not exist
- WordPress Backup
- Will activating a different theme preserve custom settings to current theme?
- I want to run different WordPress websites under the same database
- Can I apply a WP theme to a specific custom page template?
- Delete database tables on theme uninstall?
- How to trigger function on theme delete?
- Setting a static home page and blog page without using the settings
- Two Navigation Menus – secondary nav is including main nav
- Possible to put header-{your_custom_template}.php in subdirectory?
- Renaming the Twenty Fourteen WordPress theme
- Protect changes made to the theme when updating
- Theme Development Admin Area [closed]
- How to set a single theme directory on a multisite blog?
- Should a child theme share the same theme options row as the parent, or should it have it’s own options row?
- Are theme .php files stored in the database?
- Static page not working
- Posts and Pages not showing on admin, but showing in theme
- Custom options below pages/posts editor?
- 1 Database for multiple WordPress themes
- Problem of running development copy of WordPress on WebMatrix?
- Different logo on homepage
- the_content() is not displaying content, why? [closed]
- What is the correct way to integrate wordpress with another php application?
- Customizing page content layout
- Tips for managing code when developing a parent theme framework
- How to transform a custom made static HTML website to a WordPress website [closed]
- Trying to uninstall a theme, but it’s hijacking my home page
- Most wp_nav_menu parameters ignored
- How To Show Different Footers For Different Post Types Pages?
- How to include stylesheet in custom admin using parent_slug
- different theme in one website
- Custom fields not displaying on front end
- My blog suddenly can’t find my stylesheet?
- Customizing 1 theme for multiple blogs in a multisite setup
- I’ve got a theme I can’t update and won’t let go
- Is there any way to modify images from a theme using the web interface?
- Trying to revive an old wordpress site, but newer versions of wordpress install a different db structure
- Switching among theme customizations
- The function is deprecated; use mysql_real_escape_string() instead
- Default and warning messages & no login
- dynamic image path within a javascript file
- Uploaded WordPress theme not finding pages and css
- Display ads by location [closed]
- WordPress Dashboard Problem [closed]
- Theme Dev | Convert Template to Theme
- WordPress Theme Migration Local to Live Assets Not Loading
- Work on theme files on a server & browser preview before installing it
- How to change images size after theme modification?
- Create a child Theme or custom Theme
- Theme Options Menu Item – Permission Issue
- Static front page displaying twice
- 2 WP websites same content different themes
- Static posts page is not working
- Changes to code not displaying
- Editing Links in the Footer of WordPress Themes with Base64 Encrypted Code?
- How to set two different themes on one WordPress? (Desktop vs. Mobile)
- Display custom_background outside wp_head()
- Widgets vs. Theme Mods
- Front End Post Submit Form
- Question about the way that wp_register_script works
- Specific theme for non logged in users
- How does a Child Theme works?
- WordPress not displaying themes in the wp-content/themes folder
- How to create child theme of already active and customized theme
- Finding wordpress file in theme editor using the theme name
- Private theme update with zip archive without deactivating the theme
- Published site reverts without changes to theme
- How to use default WP form elements to interact with custom DB table?
- Full page (no WP admin menus and options) admin theme options
- Customizer – loading settings/controls/sections/panels based on a id/page id
- Any Good WordPress Themes Compatible With The BBPress Plugin? [closed]
- Template messed up on viewing posts
- Show hyperlinks only when user is loggedin
- What data does WordPress theme update pull If there is an update?
- Display WordPress comments before the plugins?
- Mobilepress fails to translate short codes
- WordPress 2022 template, how to see the blocks added in post template on post edit?
- WPCLI search and replace in a particlar site dir effect another site-dir
- Managing Custom Designed Content
- WordPress Multisite platform for different city for single db
- Create /archive page in WordPress Theme
- How can I either move the nav bar down or create more space for the header? Theme – Ajaira
- Consolidate ‘add-to-cart’ buttons into one ‘add-all-to-cart’ button
- Why does WP theme not look like promoted? [closed]
- Adding PHP code to single template in 2023 edition of WordPress theme