• Resolved Justin Near

    (@justinneargmailcom)


    I created a child theme for the custom theme here – http://teamwesports.com/ – but the css for my child isn’t loading.

    child CSS:

    /*
    Theme Name: Team WE Child
    Theme URI: http://teamwesports.com/
    Description: Team WE Child Theme
    Author: Justin Near
    Author URI: http://nearestpublishing.com
    Template: TeamWETheme-1
    Version: 1.0.0
    */

    /* =Imports styles from the parent theme
    ————————————————————– */
    @import url(‘../TeamWETheme-1/style.css’);

    The header.php on the original theme calls the stylesheet url:

    <link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>”>

    And I gave the server a couple of days to process (the CSS for the child theme was saved on Sunday).

    What am I doing wrong?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Check the folder name of the parent theme. Folder names are case sensitive.

    Thread Starter Justin Near

    (@justinneargmailcom)

    Not it 🙂 It was copied and pasted, and is the same in both the folder location and in the css – “/wp-content/themes/TeamWETheme-1/style.css”

    There are several other style sheets mentioned in the header (though the particular style that I want to change is in the main style.css) – would those be interfering somehow?

    <?php if ( is_front_page() || is_404()) { ?>
    		<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/home.css">
    	<?php } ?>
    
    	<?php if ( is_front_page() || is_page_template('blog.php') || is_single() || is_404()) { ?>
    		<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/blog.css">
    	<?php } ?>	
    
    	<?php if ( is_page_template('page-landing.php' || 'page-bio.php' || 'page-progdetail.php' || 'page-wide.php' || 'page-schedule.php') || is_front_page() )	{ ?>
    		<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/subpage.css">
    	<?php } ?>
    
    	<?php if ( is_page_template('page-schedule.php') )	{ ?>
    		<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/schedule.css">
    	<?php } ?>
    
    	<?php if ( is_page_template('page-secondary.php') || is_page('contact'))	{ ?>
    		<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/secondary-pgs.css">
    	<?php } ?>
    
    	<?php if ( is_page('store') )	{ ?>
    		<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/store.css">
    	<?php } ?>

    Why do you think it’s not working? Try adding this to the child theme style.css file:

    body {
       border: 2px solid red;
    }

    The child theme’s CSS file is loading. I’ll bet you don’t think it’s loading because when you examine the #content DIV using Chrome DevTools, it doesn’t show the CSS rule from your child theme, but the problem is you have a syntax error. Instead of @media-screen, it should be @media screen; take out the hyphen between @media and screen.

    Thread Starter Justin Near

    (@justinneargmailcom)

    Uh, yup. I feel stupid, but thanks a ton!!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Child theme css not loading’ is closed to new replies.