WordPress.org

Ready to get started?Download WordPress

Forums

How do I add CSS to a Child Theme (15 posts)

  1. Matthew
    Member
    Posted 1 year ago #

    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

  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    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.

  3. Matthew
    Member
    Posted 1 year ago #

    How do I Activate it?

  4. Matthew
    Member
    Posted 1 year ago #

    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;
    }
  5. Matthew
    Member
    Posted 1 year ago #

    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' );
    ?>
  6. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    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.

  7. Matthew
    Member
    Posted 1 year ago #

    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' );
  8. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    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

  9. Matthew
    Member
    Posted 1 year ago #

    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;
    }
  10. Andrew
    Forum Moderator
    Posted 1 year ago #

    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.

  11. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    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)
  12. Matthew
    Member
    Posted 1 year ago #

    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".

  13. Matthew
    Member
    Posted 1 year ago #

    What does FTP stand for?

  14. esmi
    Forum Moderator
    Posted 1 year ago #

  15. Matthew
    Member
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic