• 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 - 31 through 45 (of 50 total)
  • Thread Starter Cebetyr

    (@cebetyr)

    Done. Sorry, it didn’t change anything.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Try this 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', 'child-reset-style') );
    
        wp_dequeue_style( 'inkthemes_reset_stylesheet' );
        wp_deregister_style( 'inkthemes_reset_stylesheet' );
    
        wp_enqueue_style( 'child-reset-style', get_template_directory_uri() . '/css/reset.css' );
    
    }
    ?>

    Thread Starter Cebetyr

    (@cebetyr)

    Done but no change, unfortunately.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Try this instead:

    <?php
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', 999 );
    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' );
    
    }
    ?>

    Thread Starter Cebetyr

    (@cebetyr)

    Sorry but no change…

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Could you clear your browser’s cache and try again?

    Thread Starter Cebetyr

    (@cebetyr)

    Absolutely. Now we’re almost there. But it is strange that it shows some, but not all, design from the child css.

    As far as I can tell these css remains now:

    .slider_wrapper #main img { width: 928; height: 320px; } Not sure about this one.
    
    /* CONTENT WRAPPER */
    
    .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 h6 {font-weight: bold; font-size: 0.9em; color: #fff; }
    
    .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; }

    The previous menu design is also not yet in place.

    Have there been a lot of changes in the parent theme stylesheet so that these child theme css that are not shown should be updated in themselves?

    I think it’s best to call for a break now. 😀

    I will check out some of the remaining css and see if they are still correct or not. I will also test to change css in the child theme to see if they turn out on the site. Is it ok if I get back to you tomorrow?

    Many thanks for your great assistance and help so far. It has been very valuable for me. Till tomorrow! Best regards, Cebetyr

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I’ve made a comparison between the theme’s stylesheet on both 1.4.0 and 1.4.6 versions and I don’t see styles being added. It’s mainly whitespace changes.

    I then looked at your website on Web’s archives and it showed that your parent theme’s style.css file (on 1.4.0) was different to the original theme’s style.css file.

    So it looks like the reason your changes are not there now is that they were wiped when the theme was updated – which is expected behaviour. Maybe you transferred some of the changes to your Child Theme style.css file but forgot some others?

    I’ve saved off the reference showing the differences between these two files: https://www.diffchecker.com/c8ble2bi
    – On the left is the parent theme style.css file from March at version 1.4.0
    – On the right is the theme’s original style.css file at version 1.4.0

    If you want to get those modifications back, a simple way would be just to copy them into your Child Theme style.css file. Looking at that Diffchecker page, it’ll be taking the snippets of the green bits and pasting them into your Child Theme style.css file.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Or I could be wrong and I don’t quite understand this tool that I used to check the Web’s archives: http://archive.org/web/ (which is a possibility too)

    Thread Starter Cebetyr

    (@cebetyr)

    Great, I’ll look into it tomorrow morning when my head has been cleared from today’s work. It definitely sounds like you’re on something there. So thanks once again with all help! Very much appreeciated. 🙂

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Here’s an example of what I see in the parent theme style.css of your website in March:

    /* CB, 15-03-06: Döljer (eftersom dessa gör att länkarna inte syns i current, hover och selected-lägen): 
    
    #menu li.current-menu-item, #menu li.current-menu-parent, #menu li.current_page_parent, #menu li:hover, #menu li.current_page_item {
    
        background:url('/web/20160506084614/http://www.avenki.se/wp-content/themes/themia-lite/images/nav.png') no-repeat -1px -154px; 
    
    }
    
    #menu li.current-menu-item a, #menu li.current-menu-parent a, #menu li.current_page_parent a, #menu li:hover a, #menu li a.selected, #menu li a:hover, #menu li.current_page_item a {
    
       	color:#fff;
    
        	background: url('/web/20160506084614/http://www.avenki.se/wp-content/themes/themia-lite/images/nav.png') no-repeat 99% -124px; 
    
    }
    
    #menu li.current-menu-item a:hover, #menu li.current-menu-parent a:hover, #menu li.current_page_parent a:hover, #menu li a:hover.selected {
    
        color:#fff;
    
    } */

    This means that a lot of the menu’s styles were commented out.

    It looks like there’s more to just taking the snippets in green in that Diffchecker page, it looks like you’re going to have to rewrite the styles in your Child Theme style.css file if you want them back.

    For example, the snippet just above (that shows commented out code) can be rewritten as the following:

    #menu li.current-menu-item, #menu li.current-menu-parent, #menu li.current_page_parent, #menu li:hover, #menu li.current_page_item {
    
        background: none;
    
    }
    
    #menu li.current-menu-item a, #menu li.current-menu-parent a, #menu li.current_page_parent a, #menu li:hover a, #menu li a.selected, #menu li a:hover, #menu li.current_page_item a {
    
       	color: #333;
        	background: none;
    }
    
    #menu li.current-menu-item a:hover, #menu li.current-menu-parent a:hover, #menu li.current_page_parent a:hover, #menu li a:hover.selected {
    
        color:#333;
    
    }

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You’re welcome

    Thread Starter Cebetyr

    (@cebetyr)

    Thank you very much, Andrew, for your help! The child theme is functioning very well indeed. I just have one major problem left:

    When I log out from the admin panel and try to login again, the domain.se/wp-admin and domain.se/login are blank or turns into a 404-page.

    To see what worked and not worked:

    1. I made backups of all themes including Themia Lite and Themia Lite child via the ftp-server.
    2. I then deleted the Themia Lite and the child theme (ftp).
    3. It now proved that I could login to the admin panel.
    4. I activated one of the standard themes via the admin panel.
    5. I logged out and could log in again. So far so good.
    6. I reinstalled the Themia Lite theme (ftp), activated it via the admin panel, and logged out.
    7. Now, it’s no longer possible to log in to the admin panel.

    So it would be much appreciated if you could help me see what might be the issue here. Many thanks in advance!

    Best regards
    Cebetyr

    Thread Starter Cebetyr

    (@cebetyr)

    Hi again,

    Between points 5. and 6. above, I forgot to add:

    5 b. I reinstalled Themia Lite (ftp), activated it via the admin panel, and logged out.
    5 c. I could log in again. So far so good.

    6. See point 6. above.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    To deactivate all of your plugins at once, can you try renaming the “plugins” folder (the folder that contains all plugins) to “plugins-old”. Then name it back to “plugins” afterwards.

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