• dso1

    (@dso1)


    Hi,

    with the 1.3 version the child theme’s additional css is not overriding the parent css.
    ie.

    
    .np-home-icon a {
    	background: red;
    }

    Earlier version (1.14) worked as it should.

    I’ve tried to enque the child css after the parent, but it neither worked.

    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    function my_theme_enqueue_styles() {
     
        $parent_style = 'news-portal-css';
     
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style ),
            wp_get_theme()->get('Version')
        );
    }

    Maybe the code is not right.

    Any help?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Mystery Themes

    (@mysterythemes)

    Hello @dso1

    Can you please replace it with the following code?

    .np-home-icon a {
    background: red !important;
    }

    Hope this will work for you.

    Thanks,

    Thread Starter dso1

    (@dso1)

    Hi,

    thank You for the quick answer!

    It works with !important, but then there are other problems:

    #site-navigation ul li.current-menu-item > a {
    	background: red !important;
    }

    this will prevent the current menu item to change color with hover.
    To solve this i have to make all menu item (hover) colors also !important.

    As i said the 1.14 version worked very well without this problem.

    Theme Author Mystery Themes

    (@mysterythemes)

    Hello @dso1

    Can you provide us the live URL so that we can check it and verify the issue ?

    Also you can take backup of current child theme and make another child theme again for 1.14 and delete current one after taking backup so that it may confirm that child theme was working properly or not & that may solve your issue.

    You can also use this plugin to generate child theme:
    Child Theme Configurator

    Hope this helps you !!

    Thanks ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Child theme additional css not working’ is closed to new replies.