Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Child Theme Not Prioritising Over Parent Theme

Discussion in 'Misc WordPress Requests' started by willowen100, Nov 2, 2017.

  1. willowen100


    Child Theme Not Prioritising Over Parent Theme, by willowen100


    I’ve been making tweaks to a child theme taken from a premium theme I purchased. Originally I was using the additional CSS panel under customise but now I would like to migrate the CSS code over to my child theme’s style.css. However, my code only seems to work if I use the !important flag.

    I’m convinced my functions.php or style.css files have been setup correctly after reading the official documentation and looking at lots of guides and I have printed the functions.php and style.css files below. The child theme is in a folder called sydney-pro-ii-child; identical to the original sydney pro theme folder just with ‘child’ on the end.



    function my_theme_enqueue_styles() {

    $parent_style = 'sydney-pro-ii-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.

    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 ),
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );


    Theme Name: Sydney Pro Child
    Theme URI: http://athemes.com/theme/sydney
    Author: aThemes
    Author URI: http://athemes.com
    Template: sydney-pro-ii
    Version: 1.0
    License: GNU General Public License v2 or later
    License URI: http://www.gnu.org/licenses/gpl-2.0.html
    Text Domain: sydney-pro-ii-child

    The code below is taken from the style.css in the parent theme and I have added it to my child’s style.css. This changes the social icons down in the footer.

    .social-menu-widget a:hover {
    color: blue;
    .social-menu-widget a {
    color: yellow;

    However, it doesn’t work unless I set the !important flag.

    .social-menu-widget a:hover {
    color: blue !important;
    .social-menu-widget a {
    color: yellow !important;

    I hope someone can shed some light on this as it will be much appreciated.


    Child Theme Not Prioritising Over Parent Theme

Share This Page

Monarch Social Sharing Plugin