it is causing problem because i did not do it before. I am trying to enqueue style or may be scripts depending on page. But it not working. Here is the code:
add_action('init', 'my_enqueue_styles');
function my_enqueue_styles(){
if(is_page('Add Event')){ // also tried slug, page id and wp_reset_query(); bot not worked
wp_deregister_style( 'jquery-ui-custom-flick' );
wp_register_style( 'jquery-ui-custom-flick', get_bloginfo('template_directory') .'/styles/jquery.ui/ui.custom.flick.css');
wp_enqueue_style( 'jquery-ui-custom-flick' );
}
}
I am not doing the conditional right. The script works without the conditional.
Thanks!
RESOLVED:
The problem was with the init
action hook. the conditional is_page()
is false when init
is called. After adding the style to the hook wp_print_styles
it worked perfectly.