Support » Themes and Templates » How do I add CSS to a Child Theme

  • Moderator Matthew

    (@kidsguide)


    Volunteer Moderator

    How do I add CSS to a Child Theme?
    I am making a child theme.

    I am trying to put these CSS codes into it, but I don’t know how.

    #comment-form .form-allowed-tags {
    display:none;
    }
    .footer-navi .right-navi {
        display: none;
    }
    .footer-navi .navigation ul.footer_des {
        width: 500px;
    }

    So far I only have the start of the Child theme.

    /*
    Theme Name:     Colorway Child Theme
    Description:    Child theme for the Colorway theme.
    Author:         Bud's Software
    Template:       Colorway
    Version:        .1
    */

    Please Help

Viewing 14 replies - 1 through 14 (of 14 total)
  • WPyogi

    (@wpyogi)


    Forum Moderator


    Your site does not have the child theme activated and you are missing the @import line – it should be:

    /*
    Theme Name:     Colorway Child Theme
    Description:    Child theme for the Colorway theme.
    Author:         Bud's Software
    Template:       colorway
    Version:        .1
    */
    
    @import url ('../colorway/style.css');

    Also uncapitalize “colorway” after “Template”

    After you’ve changed those you must activate the child theme.

    Moderator Matthew

    (@kidsguide)


    Volunteer Moderator


    How do I Activate it?

    Moderator Matthew

    (@kidsguide)


    Volunteer Moderator


    Do I just do it like this?

    /*
    Theme Name:     Colorway Child Theme
    Description:    Child theme for the Colorway theme.
    Author:         Bud's Software
    Template:       colorway
    Version:        .1
    */
    
    @import url ('../Colorway Child Theme/style.css');
    
    #comment-form .form-allowed-tags {
    display:none;
    }
    
    .footer-navi .right-navi {
        display: none;
    }
    
    .footer-navi .navigation ul.footer_des {
        width: 500px;
    }
    Moderator Matthew

    (@kidsguide)


    Volunteer Moderator


    This is what I have done.

    /*
    Theme Name:     Colorway Child Theme
    Description:    Child theme for the Colorway theme.
    Author:         Bud's Software
    Template:       colorway
    Version:        .1
    */
    
    @import url ('../Colorway Child Theme/style.css');
    
    <?php
    
    #comment-form .form-allowed-tags {
    display:none;
    }
    
    .footer-navi .right-navi {
        display: none;
    }
    
    .footer-navi .navigation ul.footer_des {
        width: 500px;
    }
    
    ?>
    
    <?php
    _e( 'Code is Poetry', 'colorway-child-theme' );
    ?>
    WPyogi

    (@wpyogi)


    Forum Moderator


    PHP tags can never go in a CSS file – take those out.

    And this line is not correct:

    @import url ('../Colorway Child Theme/style.css');

    Look at my example above.

    Moderator Matthew

    (@kidsguide)


    Volunteer Moderator


    Like this

    /*
    Theme Name:     Colorway
    Description:    Child theme for the Colorway theme.
    Author:         Bud's CSS Plugins
    Template:       colorway
    Version:        .1
    */
    
    @import url ('../colorway/style.css');
    
    #comment-form .form-allowed-tags {
    display:none;
    }
    
    .footer-navi .right-navi {
        display: none;
    }
    
    .footer-navi .navigation ul.footer_des {
        width: 500px;
    }
    
    _e( 'Code is Poetry', 'colorway-child-theme' );
    WPyogi

    (@wpyogi)


    Forum Moderator


    Take out this line :

    _e( 'Code is Poetry', 'colorway-child-theme' );

    And activate the child theme –

    http://codex.wordpress.org/Using_Themes#Selecting_the_Active_Theme

    Moderator Matthew

    (@kidsguide)


    Volunteer Moderator


    When I upload it it goes

    The package could not be installed. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

    This is the finished Child Theme

    /*
    Theme Name:     Colorway
    Description:    Child theme for the Colorway theme.
    Author:         Bud's CSS Plugins
    Template:       colorway
    Version:        .1
    */
    
    @import url ('../colorway/style.css');
    
    #comment-form .form-allowed-tags {
    display:none;
    }
    
    .footer-navi .right-navi {
        display: none;
    }
    
    .footer-navi .navigation ul.footer_des {
        width: 500px;
    }
    Moderator Andrew Nevins

    (@anevins)


    Forum moderator


    When I upload it it goes

    Can you upload it via FTP?

    Or if it’s just a style.css file you need to use, try using this One Click Child Theme.

    WPyogi

    (@wpyogi)


    Forum Moderator


    Are you using FTP to upload it to your themes folder?

    wordpress
       wp-content
         themes
           colorway
           other themes will be in here too
           colorwaychild (must go here)
    Moderator Matthew

    (@kidsguide)


    Volunteer Moderator


    Or if it’s just a style.css file you need to use, try using this One Click Child Theme.

    I tried it but it said “error”.

    Moderator Matthew

    (@kidsguide)


    Volunteer Moderator


    What does FTP stand for?

    esmi

    (@esmi)


    Forum Moderator


    Moderator Matthew

    (@kidsguide)


    Volunteer Moderator


    I don`t think I am going to make a Child Theme.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘How do I add CSS to a Child Theme’ is closed to new replies.