How to use wp_enqueue_style?

1

How do I make the contact.php page use the contact.css file using the wp_enqueue_style function in Wordpress?

function terradecultivo_scripts() { 
if (contato.php) {  
    wp_enqueue_style('terra-style', get_stylesheet_uri() . '/contato.css' );
    }
}
add_action( 'wp_enqueue_style', 'terra-style' );

This code I put in function.php

    
asked by anonymous 19.12.2014 / 20:13

1 answer

3

Have you tried is_page_template ? Something like:

if ( is_page_template( 'contato.php' ) ) {
     wp_enqueue_style('terra-style', get_stylesheet_uri() . '/contato.css' );
} 

Reference link

    
20.12.2014 / 18:52