Use wp_enqueue_style
to add additional stylesheets to a theme. Additionally, you can use it with a Child Theme to preserve your edits in case the original theme is updated.
function wpa_form_style() {
wp_enqueue_style(
'my-form-styles',
get_stylesheet_directory_uri() . '/my-form-styles.css'
);
}
add_action( 'wp_enqueue_scripts', 'wpa_form_style' );
or if you only need your styles for a specific page, conditionally enqueue it with a check for is_page()
:
function wpa_form_style() {
if( is_page( 'contact' ) ){
wp_enqueue_style(
'my-form-styles',
get_stylesheet_directory_uri() . '/my-form-styles.css'
);
}
}
add_action( 'wp_enqueue_scripts', 'wpa_form_style' );