• Hi,

    After upgrading to WordPress version 4.5.3–sv_SE and Themia LiteVersion 1.4.6 the child theme does no longer override the parent.

    Before the theme upgrade the child worked well, also even after the WordPress upgrade.

    I remember having a lot of problem before the child overrode the parent when creating the site, but the below code finally made it (but it read 1.4.0 before today’s upgrade).

    themia-lite-child/style.css:

    /*
     Theme Name: Themia Lite Child
     Description: Themia Lite Child Theme
     Author:
     Author URI:
     Template: themia-lite
     Version: 1.4.6
    */
    
    themia-lite-child/functions.php:

    <?php
    add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
    function theme_enqueue_styles() {
    wp_enqueue_style( ‘child-style’, get_stylesheet_directory_uri() . ‘/style.css’, array(‘parent-style’) );
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
    }
    ?>
    `

    I have also tried to rename the child-folder’s name temporarily and to activate another theme to “zero” any settings but that didn’t help.

    Would very much appreciate your advice!

    Best regards

Viewing 15 replies - 16 through 30 (of 50 total)
  • Thread Starter Cebetyr

    (@cebetyr)

    Yes, that’s right.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I’m not sure I can spot why it was working before and why it isn’t now. So I’m just going to look at getting it working now.

    Try removing the parent style.css call so that we only have 1 of the stylesheets coming up (this will help narrow down the issue).

    For example, if you’re using the original code then the result would be:

    <?php
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
    wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style') );
    }
    ?>

    Thread Starter Cebetyr

    (@cebetyr)

    Yes, that’s a good way. Have updated the functions.php as per your suggestion now. But no success yet. 🙂

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Would it be okay to link your site? Otherwise you’ll have to keep creating pastebin pages with the updated source code

    Thread Starter Cebetyr

    (@cebetyr)

    avenki.se

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    A slight modification; could you try this code instead:

    <?php
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
    wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css' );
    }
    ?>

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Another update, try this code instead:

    <?php
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
    wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array('inkthemes_main_stylesheet') );
    }
    ?>

    Thread Starter Cebetyr

    (@cebetyr)

    Absolutely!

    The right fonts are shown now. So something happened here…

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Is this with the code in my last post, or in my second to last post?

    Thread Starter Cebetyr

    (@cebetyr)

    Hoops! It was the first one. But I have changed to second one now. And it is getting closer. 🙂

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Okay now the order in the source code is correct:

    <link rel='stylesheet' id='inkthemes_main_stylesheet-css'  href='http://www.avenki.se/wp-content/themes/themia-lite/style.css?ver=4.5.3' type='text/css' media='all' />
    <link rel='stylesheet' id='child-style-css'  href='http://www.avenki.se/wp-content/themes/themia-lite-child/style.css?ver=4.5.3' type='text/css' media='all' />

    Can you point out specific styles that still aren’t working?

    Thread Starter Cebetyr

    (@cebetyr)

    The most styles do not yet work actually:

    `
    body { font: 13px/1.5 Arial,Helvetica,sans-serif; } The font type works but not the size.

    p { font: 13px/1.5 Arial,Helvetica,sans-serif; } The font type works but not the size.

    .content_wrapper .side_content .post h1.post_title { font-family:Arial,Helvetica,sans-serif; font-size: 1.3em; line-height: 25px; font-weight: bolder;} The font type works but not the size.

    h6 { font-size: 0.7em; /* Datumformat vid posts (inlägg = nyheter) */ }

    .slider_wrapper #main img { width: 928; height: 320px; }

    /* CONTENT WRAPPER */

    .content_wrapper .side_content .post { background:url(../themia-lite/images/postbg.png); border: 1px solid #c2b59b; }

    .content_wrapper .side_content .post { background: url(http://avenki.se/wp-content/themes/themia-lite-child/images/postbg.png); }

    .read_more { display: none !important; } */

    .feature_content { margin-bottom: 0; }

    .feature_content img { background-color: #c2b59b; }

    /* POSTS */
    .content_wrapper .side_content .post .post_info { display:none !important; } */

    .content_wrapper .side_content .post .post_info li { display:none; }!important

    .content_wrapper .side_content .post .post_info li a { display:none !important; }

    .content_wrapper .side_content .post .post_info li.postedin a { display:none !important; }

    .content_wrapper .side_content .post .continue { display: none !important; } */

    .postedon {font-size: 0.85em; }

    /* SIDEBAR */

    .sidebar .wrap_sidebar { border: 1px solid #c2b59b; background:url(../themia-lite/images/postbg.png); }

    .sidebar .wrap_sidebar h2.title, .sidebar .wrap_sidebar h2
    { background: url(../themia-lite/images/sidebar-title1.png) no-repeat; width:324px; height:44px; margin-left:-22px; padding-left:22px;
    padding-top: 16px; font-size: 1.1em; letter-spacing:0; font-weight: bold; color: fff !important; text-shadow: 0 1px 0 #f8f3ea; }

    .sidebar .wrap_sidebar .side_content .shadow
    { background: url(“../themia-lite/images/post-shadow.png”) no-repeat scroll center top rgba(0, 0, 0, 0); height: 19px; margin-bottom: 30px; margin-top: -1px; }

    /* LINKS */

    a { text-decoration:none; color:#617cab; !important; }
    a:visited { color: ##928874; }
    a:hover { color: #e41e26;}
    a:active { color: #e41e26;}
    a.selected { color: #e41e26; font-weight: bold; }

    .read_more { color: #617cab; font-size: 1em;}

    .read_more.a { color: #617cab; font-size: 1em;}
    .read_more:visited { color: ##928874; font-size: 1em; }
    .read_more:hover { color: #e41e26; font-size: 1em; }
    .read-more:active { color: #e41e26;}
    .read-more.selected { color: #e41e26; font-size: 1.02em; font-weight: bold; }

    post.a { text-decoration:none; color:#617cab; !important; }

    post.a:visited { color: ##928874; }
    post.a:hover { color: #e41e26;}
    post.a:active { color: #e41e26;}
    post.a.selected { color: #e41e26; font-size: 1.02em; font-weight: bold; }

    /* FOOTER */

    .footer_wrapper, .footer_wrapper h1, .footer_wrapper h2, .footer_wrapper h3, .footer_wrapper h4, .footer_wrapper h5, .footer_wrapper h6,

    .footer_wrapper a, .footer_wrapper p, .footer_wrapper pre, .footer_wrapper .footer_widget ul li
    { font-family: Arial, Helvetica, sans-serif; color: #fff; text-shadow: none;}

    .footer_wrapper h6 {font-weight: bold; font-size: 0.9em; color: #fff; }

    .footer_bg { background-image: none; background-color: #231f20; border-top: thick solid #c2b59b; padding: 20px 0 0 20px; } /* Black footer area with beige border */

    .footer_wrapper { padding-top: 5px ; padding-bottom: 20px; }

    .footer_line { background-color: #231f20; color: #FFFFFF; padding-bottom: 50px; padding-right: 10px; padding-top:0; width: 100%; }

    .footer_line span.blog-desc { float: left; font-family: Arial, Helvetica; sans-serif; color: #CCC; }

    .footer_line .copyright { text-align: right; font-family: Arial, Helvetica; sans-serif; color: #CCC; }

    .footer_line .copyright a { color: #CCC; font-size: 0.8em; }

    .copyright, span.blog-desc {border-top: thin solid #5a5447; padding-top: 40px;}

    /* SPECIAL CLASSES */

    .dotted_line { visibility: hidden; }

    ´

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    body { font: 13px/1.5 Arial,Helvetica,sans-serif; }

    The font type works but not the size.

    Where are you looking to test this, which bit of text are you expecting to be 13 pixels tall? When I checked the text on the Home page[1], it was 13 pixels tall in reference to a style that you’ve set on paragraphs:

    p { font: 13px/1.5 Arial,Helvetica,sans-serif; }

    [1] Avenki har ett tydligt fokus på komplexa integrations­projekt för telefoni- och kommunik­ations­lösningar. Vår långa erfarenhet inom bl a telefo…

    Thread Starter Cebetyr

    (@cebetyr)

    I just compare with the look it had before the upgrade.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Try replacing the code I recommended for your functions.php file with this:

    <?php
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
    
        wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array('inkthemes_main_stylesheet', 'child-reset-style') );
    
        wp_dequeue_style( 'inkthemes_reset_stylesheet' );
    
        wp_enqueue_style( 'child-reset-style', get_template_directory_uri() . '/css/reset.css' );
    
    }
    ?>

Viewing 15 replies - 16 through 30 (of 50 total)
  • The topic ‘Child theme does not override parent’ is closed to new replies.