Answers for "can't use is_home query on init hook"

0

can't use is_home query on init hook

add_action( 'wp', 'wpse47305_check_home' );
function wpse47305_check_home() {
    if ( is_home() )
        add_action( 'wp_enqueue_scripts', 'my_scripts' );
}

function my_scripts() {
    ...
}
Posted by: Guest on April-21-2020

Browse Popular Code Answers by Language