• Resolved tradesouthwest

    (@tradesouthwestgmailcom)


    Enqueued child theme style exactly like the mh mag support suggest and now I get mh-magazine-lite-child style loaded twice. I am only concerned because gtmetrix says I am loading the same resource (file) twice.

    Once with ver: 4.7.5 and another with ver: 2.6.6 – any ideas of what is the cause?

        https://www.ipscell.com/wp-content/themes/mh-magazine-lite-child-1/style.css?ver=2.6.6
        https://www.ipscell.com/wp-content/themes/mh-magazine-lite-child-1/style.css?ver=4.7.5
    function mh_magazine_lite_child_styles() {
        wp_enqueue_style('mh-magazine-lite-parent-style', get_template_directory_uri() . '/style.css');
        wp_enqueue_style('mh-magazine-lite-child-style', 
    get_stylesheet_directory_uri() . '/style.css', array('mh-magazine-lite-parent-style'));
    }
    add_action('wp_enqueue_scripts', 'mh_magazine_lite_child_styles');
    • This topic was modified 8 years, 10 months ago by tradesouthwest.
    • This topic was modified 8 years, 10 months ago by tradesouthwest. Reason: wrong link
    • This topic was modified 8 years, 10 months ago by tradesouthwest. Reason: correct uri
Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi,

    thanks for using MH Magazine lite.

    It’s very likely that there is an issue with your child theme. We can’t debug 3rd party code here, but you could have a look at the code of one of the freely available child themes for this theme to see how it’s done right (e.g. here).

    Thread Starter tradesouthwest

    (@tradesouthwestgmailcom)

    You may want to change the documentation on this page then: https://www.mhthemes.com/support/creating-and-using-child-themes-wordpress/ – I took my “3rd party” code from there.

    Do you have a link to the MH Magazine lite (Child)? The link you included above does not work for the MH-Magazine-lite.

    It seems there is a misunderstanding. The page you’re referring to contains general information in order to help people understand the concept behind child themes. It doesn’t mean you can copy & paste the code 1:1 and then you’re done, especially not since the code doesn’t apply to your theme. Here you can find more information about child themes as well: Child Themes – WordPress Codex.

    The link you included above does not work for the MH-Magazine-lite.

    The code we linked in the previous reply actually is working code for a MH Magazine lite child theme (that child theme even is listed on WordPress.org). You can use the code as a reference for your child theme and modify it accordingly. Also make sure you get rid of the customizations as they probably won’t apply to what you’ve planned.

    Keep in mind that you only will need a child theme if you’re familiar with coding and in case you want to modify code. In case you’re not familiar with coding and don’t plan any major code modifications, then you don’t need a child theme.

    Minor CSS customizations can be added in your WordPress dashboard under Appearance => Customize => Additional CSS.

    Thread Starter tradesouthwest

    (@tradesouthwestgmailcom)

    Sorry but this is just plain ridiculous. I followed the example on the link you put above and the theme got a white screen. Why does this theme not save the child stylesheet like a normal theme. When I save the child theme styles it show the older styles from the child stylesheet that are not even on the site. And yes, I cleared all cache and removed plugins… it appears as if the theme will not enqueue a stylesheet but only once and then no changes are accepted. Where is this “phanthom” stylesheet coming from? It is NOT some CDN or W3 or any other plugin. They are all disabled.

    Sorry but this is just plain ridiculous.

    Mate, there is no need to get angry here. Please be aware that your issue doesn’t have anything to do with the theme itself, you’re simply not coding your child theme properly and it’s probably not appropriate to blame other people for that. Especially not in a free forum where you’re asking for help.

    I followed the example on the link you put above and the theme got a white screen.

    When you get a white screen, then you have a coding error, for example PHP syntax error. And of course you shouldn’t just add the code from another child theme 1:1 but adapt it accordingly to match the name and structure of your child theme…

    Where is this “phanthom” stylesheet coming from?

    When loading the parent stylesheet from within the child theme, you of course need to ensure that the ID matches. For example the correct ID of the parent stylesheet is mh-magazine-lite, if you call it from your child theme as mh-magazine-lite-parent or else it won’t match of course and the parent stylesheet will load twice.

    As mentioned before, there are plenty free correctly coded child themes for MH Magazine lite available on WordPress.org (for example here). If you’re struggling to code a child theme properly, you could simply have a look at the code and use it as a template to code your own child theme.

    Again, please understand that coding a child theme doesn’t have anything to do with the theme itself, it’s basic WordPress knowledge. If you’re still struggling to code a child theme correctly (even after checking the WordPress Codex), then it probably would make sense to hire a freelancer who is familiar with coding.

    • This reply was modified 8 years, 9 months ago by Michael.
    Thread Starter tradesouthwest

    (@tradesouthwestgmailcom)

    Thanks, the 3rd to the last paragraph was what fixed everything (the ID). The examples did not help but this reply fixed it instantly.

    In hopes this thread helps alleviate frustration for other theme users….

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘child theme style loads twice’ is closed to new replies.