• Resolved Dave Foy

    (@fuzzyness)


    I wanted to remove the big list of inline theme styles from my source code. So I checked the ‘Don’t load popup theme styles to the head’ setting.

    This removed the inline CSS just fine.

    Then I added the ‘Light Box’ theme CSS into my child theme style.css. Then the popup didn’t look right. Quite a few styles (not all of them) were missing.

    After a couple of hours of detective work, I’ve found out why.

    WITH your styles in place – this is the order the styles load in <head>:

    1. Popup Maker main plugin CSS
    2. My child theme CSS
    3. Popup Maker inline theme styles

    WITHOUT your styles (checking the box):

    1. My child theme CSS
    2. Popup Maker main plugin CSS

    So when I turn off your theme styles, your default CSS is now overriding my copied ‘Light Box’ theme CSS. Previously, my child theme styles came AFTER yours, so they weren’t being overridden.

    I’ve tried to figure out how to change the order. I need to load your main CSS BEFORE my child theme CSS, just like it does by default. But I just can’t work out how to do it.

    I’ve temporarily solved the problem by placing my custom styles inline in the footer of the site. At least that way, they 100% for certain load after your main styles. ?? But it’s not a good solution.

    Can you help?

Viewing 10 replies - 1 through 10 (of 10 total)
  • waltmesser

    (@waltmesser)

    @fuzzyness

    Sorry you’re having difficulties, I’m sure we can this resolved.

    I’ll have our Lead Dev @danieliser offer his advice on the issue as soon as possible.

    Thank you for being patient.

    Thread Starter Dave Foy

    (@fuzzyness)

    Thanks @waltmesser (and @danieliser). Looking forward to it.

    Plugin Author Daniel Iser

    (@danieliser)

    @fuzzyness – v1.5 is in beta right now and has additional options to disable both the core styles & custom theme styles. It also has both available for easy copying to your own stylesheet when you need to update.

    Then you can just disable both, copy them in order to your stylesheet and reduce an extra request at the same time (core styles).

    https://github.com/PopupMaker/Popup-Maker/issues/377

    The beta will be officially announced on the site shortly or you can grab the release/1.5 branch from the repo.

    Hope that helps. Please take a moment to click that it Works and to rate and review the plugin or support.

    Thread Starter Dave Foy

    (@fuzzyness)

    Thanks @danieliser.

    I’ve installed 1.5. I might be doing something wrong, but I don’t see any different options than before?

    Here’s the settings screen I see:
    https://cl.ly/3d3b0o1p231n

    Here’s my plugin settings, showing 1.5 activated:
    https://cl.ly/220h3E433h0F

    I tried removing the inline styles I’d previously placed in the footer and moved them to my custom CSS. The lightbox display was definitely better this time… but the X close button didn’t work.

    I’d like to leave the inline popup theme styles out of the footer to show you what happens, but I can’t because the site is live.

    Thanks.

    Plugin Author Daniel Iser

    (@danieliser)

    @fuzzyness – Looks like you didn’t get v1.5.

    https://github.com/PopupMaker/Popup-Maker/archive/release/1.5.zip

    Be sure to open that zip file and rename the folder to just popup-maker before you upload it to your own site.

    Thread Starter Dave Foy

    (@fuzzyness)

    By the way, just to be clear. the 1.5 update has now worked. I now see the 3 checkbox settings. But the pop-ups are still broken.

    Thread Starter Dave Foy

    (@fuzzyness)

    And also I noticed that having 1.5 beta installed also broke things in my WP control panel. Hovering over the left hand menu didn’t open the sub-menus (e.g Settings). And also I couldn’t see or click into the content editing textarea anymore.

    As soon as I reverted back, everything was back to normal.

    I’ve just reverted back for now. I’m just loading an additional custom stylesheet in head, that contains my popup theme styles, plus a few custom styles. That works fine for now. I’ll revisit again when 1.5 is released and is stable.

    I’m loading files over http2 via a CDN so the extra request isn’t a problem for me.

    Thanks for your help.

    Thread Starter Dave Foy

    (@fuzzyness)

    If anyone else runs into this problem, I solved it by checking to remove styles, then putting my popup theme styles in a custom stylesheet. I put that CSS file in my child theme folder, and then added this to my functions.php:

    function theme_enqueue_scripts() {
    wp_enqueue_style( ‘Style’, get_stylesheet_directory_uri() . ‘/popupmaker-custom.css’ );
    }
    add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_scripts’, ‘200’ );

    I had to add the 200 to force it to load after the main Popup Maker styles.

    No idea if that’s the best way of handling this, but it works.

    I’ll remove this as soon as 1.5 is released and hopefully fixes the issue.

    Plugin Author Daniel Iser

    (@danieliser)

    @fuzzyness – Can you possibly dig into the code of your theme or whatever is being used to create those custom Popup Styles. Not sure why they would load them so high. In all reality a theme and override styles like that should be loaded with high priority like your 200. Simply because plugins generally load their stuff at 10 or 11. We do 10 the default which should always come before a themes stylesheet generally speaking.

    You could try editing our code popup-maker/includes/scripts.php and adding , 9 to the add_action for site scripts.

    Simply loading your themes custom popup styles after our css file which is how it works 99.99% of the time would fix it in your case.

    Hope that helps.

    Also we have not had any reports of the broken admin, likely a conflict with another plugin. Can you use https://wppopupmaker.com/support and submit test admin credentials so I can see that in action and get it fixed if its on our end?

    waltmesser

    (@waltmesser)

    Closing this ticket due to inactivity. If you’re still having an issue, create a new thread, link this one, and we will continue troubleshooting.

    Please take a moment to rate and review our plugin and/or support.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Wrong order of styles loading when turning off theme styles’ is closed to new replies.