Where do I put my create_new_table function()?

The code you are currently using for being used as a plugin. register_activation_hook is reserved for plugin use only. It only fires when plugin in activated. If you want to create database table from your theme you can use after_switch_theme. It can be used like bellow: add_action(“after_switch_theme”, “mental_health_providers_create_db”); function mental_health_providers_create_db() { global $wpdb; $charset_collate = … Read more