Wordpress - Getting failure when using filemtime() with wp_enqueue_style
It's because you're retrieving it via URL, but filemtime()
requires a path. Use get_stylesheet_directory()
instead. That returns a path:
function pro_styles()
{
wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() .'/child-style.css', array(), filemtime(get_stylesheet_directory() .'/child-style.css'), 'all' );
}
add_action( 'wp_enqueue_scripts', 'pro_styles' );