Replace Content of Sidebar on Custom Post Type

After a lot of trying and testing, I think I’ve found a solution: add_filter( ‘sidebars_widgets’, ‘exchange_sidebars’, 10); function exchange_sidebars( $sidebars_widgets ){ global $post; // Define the sidebar which should be exchanged $selected_sidebar=”sidebar-1″ // IF we are on a custom post type // AND it is a Child Page (= page has post_parent) // THEN change … Read more

Activate Plugin Automatically After Set Time

Add this to the functions.php file of your active (child) theme- add_action( ‘init’, ‘wpse_393267_activate_plugin’ ); function wpse_393267_activate_plugin() { if( !function_exists( ‘is_plugin_active’ ) ) { include_once ABSPATH . ‘/wp-admin/includes/plugin.php’; } $plugin_to_activate=”jetpack/jetpack.php”; // plugin-dir/plugin-file.php $date_to_activate=”2021-08-13″; // YYYY-MM-DD if( is_plugin_active( $plugin_to_activate ) ) return; if( time() >= strtotime( $date_to_activate ) ) { activate_plugin( $plugin_to_activate ); } } Change … Read more