This code works well to link in the stylesheet style_test.css
/* add link to stylesheet to the head section */
add_action( 'wp_enqueue_scripts', function() {
$child_folder = trailingslashit( get_stylesheet_directory_uri() );
wp_enqueue_style( 'style', $child_folder . 'style_test.css' );
} );
I want to only load it into the <head> for one page and have tried this:
/* add link to stylesheet to the head section of page Test (id=337)
add_action( 'wp_enqueue_scripts', function() {
if(is_single(337)) {
$child_folder = trailingslashit( get_stylesheet_directory_uri() );
wp_enqueue_style( 'style', $child_folder . 'style_test.css' );
}} );
*/
But this stops it working altogether.
Thank you, Paul