Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Where and how should I add the css file that I want my forms to use?

Thank you!

share|improve this question
    
add styles in main stylesheet "style.css" in theme directory –  Anjum Aug 19 '13 at 15:45
    
@Anjum thank you - is it usually done manually? Or through some wordpress cms setting? –  Genadinik Aug 19 '13 at 15:49
    
just copy css styles and paste in the bottom of style.css –  Anjum Aug 19 '13 at 16:24
add comment

1 Answer

up vote 2 down vote accepted

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' );
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.