Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 504799

Child theme CSS not overriding parent theme

$
0
0

Replies: 0

I’m trying to figure out why my style.css is not overriding the parent style.css.
My child theme folder structure looks like this:

themes
- simplemag
  - style.css
  - css
    - icons.css
    - framework.css
  - [some other folders and files]
- simplemag-child
  - css
    - icons.css
    - framework.css
  - [some other folders and files]
  - style.css
  - functions.php

style.css from the child theme

/*
Theme Name: SimpleMag
Theme URI: http://themesindep.com/
Author: ThemesIndep
Author URI: http://themesindep.com/
Description: Magazine theme for creative things
Template: simplemag
Version: 2.0
*/

/* Your CSS code goes here */

/*
.post .content p {
text-align:justify;
}
*/

@media only screen and (min-width: 801px) {
	.entry-image {
		opacity:1;
	}
}

functions.php from the child theme

<?php
/**
 * SimpleMag child theme functions & definitions
 * child theme: simplemag-child/style.css
 * child theme version 2.0
 * parent theme: simplemag/style.css
 * parent theme version 2.2.1
**/

function theme_enqueue_styles() {

    $parent_style = 'parent-style';

    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style',
        get_stylesheet_directory_uri() . '/style.css',
        array( $parent_style ),
        wp_get_theme()->get('Version')
    );
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );

?>

Could any one help to me to see what I am missing?

  • This topic was modified 25 minutes ago by  qvyang.
  • This topic was modified 24 minutes ago by  qvyang.

Viewing all articles
Browse latest Browse all 504799

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>