1

You can use add_rewrite_rule(): add_action( 'init', function(){ // Non-paged requests. E.g. example.com/categoryname/search/keyword/ add_rewrite_rule( '^categoryname/search/([^/]+)/?$', 'index.php?category=categoryname&s=$matches[1]', 'top' ); // For paged requests. E.g. example.com/categoryname/search/keyword/page/2/ ...


1

Please add below code in your footer.php file above included JavaScript files : <?php if ( is_active_sidebar( 'footer-1' ) ){ dynamic_sidebar( 'footer-1' ); } if ( is_active_sidebar( 'footer-2' ) ){ dynamic_sidebar( 'footer-2' ); } if ( is_active_sidebar( 'footer-3' ) ){ dynamic_sidebar( 'footer-3' ); } ?>


1

init is not the first action to run on a WordPress install. Here is a basic rundown of a typical stack order. https://codex.wordpress.org/Plugin_API/Action_Reference Try hooking into `muplugins_loaded'. I don't believe it is conditional, so it should run every time. https://codex.wordpress.org/Plugin_API/Action_Reference/muplugins_loaded <?php ...


1

I like the idea of running this through a schedule event in WordPress, https://codex.wordpress.org/Function_Reference/wp_schedule_event Here is a snippet that hopefully will get you there: <?php if(!wp_next_scheduled('daily_plugin_check')){ wp_schedule_event( time(), 'daily', 'daily_plugin_check' ); } add_action( 'daily_plugin_check', '...


1

What about using WordPress Options API to store a flag whether it is the first switch or not: https://codex.wordpress.org/Options_API <?php add_action('after_switch_theme', 'setup_theme_options'); function setup_theme_options () { if(get_option('first_theme_activation') === false){ // Set a flag if the theme activation happened ...


1

Try : add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); function custom_override_checkout_fields( $fields ) { if(is_user_logged_in()){ unset($fields['billing']['billing_email']); } return $fields; } Source : https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/


1

You have to replace $post_id with get_the_id(); function status_alerts($query) { //start function global $post; // set the global $args = array( // all posts in the status post format 'posts_per_page' => -1, 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array( 'post-format-status' ), 'operator'=> 'IN' ...


Only top voted, non community-wiki answers of a minimum length are eligible