• Resolved johnnyr860

    (@johnnyr860)


    Hello I am currently using the Unite wordpress theme and my site can be viewed here.

    I have the child theme currently activated and if you notice the links on the menu bar are grey but if I were to use the original (parent) theme the links on the menu bar would be white not grey. How do I fix this so that my menu bar links show up as white like the parent theme?

    Also there is a small white border that goes around the entire template that only shows up when I use the child theme. I do not see this border when I activate the parent theme. How do I get rid of this border? Help is appreciated thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Theme Author Silkalns

    (@silkalns)

    You must have this line of code inside Child Themestyle.css to import original stylesheet form Unite Parent Theme.

    @import url("../unite/style.css");

    Since you use more “advanced” method and enqueued stylesheet you need to set different priority for that because theme style sheet must be loaded after all others. Not sure if priority of “11” will be enough but just give it a try and tweak it from there.

    <?php
    
    add_action( 'wp_enqueue_scripts', 'unite_child_enqueue_styles', 11 );
    function unite_child_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    
    ?>

    Replace your existing code in Child Theme functions.php with this one instead or at least modify it.

    Thread Starter johnnyr860

    (@johnnyr860)

    Yea well now I have a problem with my site. I inserted the @import code into my site and it works great however when I replaced the code in my child theme functions with the 2nd code you gave me it did something to my site that now causes it not to open or load.

    If you look at the site again you won’t be able to see anything because all it shows is a blank white page. I don’t even have access to wp-admin. When I went to creativeonlinegenius.com/wp-admin I get a blank white page I can’t even access the dashboard. How would I fix this?

    Edit: I was able to delete the functions.php file from my hosting cpanel and the site is back. However the issue is that the code you gave me causes my website to go to a blank white screen and won’t even let me access the wp-admin when I use it so I have no clue how to go about it. Each time this happens I have to go to my cpanel and delete the functions.php file just to gain access to wp-admin again. Not sure if you recommend a different code I can use or how to go about it.

    Theme Author Silkalns

    (@silkalns)

    You don’t need my second code if you already using @import. First option is enough and just stick with it.

    Theme Author Silkalns

    (@silkalns)

    For other who have found this thread and one to use my second method they should use code like this:

    <?php
    
    add_action( 'wp_enqueue_scripts', 'unite_child_enqueue_styles', 11 );
    function unite_child_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    }
    ?>

    There were missing curly bracket. Sorry about that.

    Still 99/100 of times make sure to use this method via Child Theme style.css

    @import url("../unite/style.css");

    Thread Starter johnnyr860

    (@johnnyr860)

    Thank you this is great I appreciate the help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘child theme still looks different than the parent theme’ is closed to new replies.