problem colors footer background and links still after installing version 1.4.2

Home Forums Reykjavik problem colors footer background and links still after installing version 1.4.2

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #20526

    griet
    Participant

    problem colors footer background and links still after installing version 1.4.2

    Resolved

    Hey there! Have you noticed this support service is provided FREE of charge?
    If you like the speed and accuracy of resolutions, please consider supporting me with a small donation. Thank you

    Consider a donation →

    hello,
    as other users, I did update theme reykjavik to new version 1.4.2 and have problems with colors footer background and links who now have your default colors and not anymore my customised colors. I did read there was a bug who was resolved in new version 1.4.2, but my WordPress says version 1.4.2 is installed and the problem continues. I’m sorry, I’m not a professionnal and english is not my first language. Maybe I did not understand something I had to do?
    (The URL, where you can see footer in blue instead of brown and link to “Home” in blue instead of green is my test url.)
    Many thanks for your help.
    Kind regards

    #20527

    Oliver Juhas
    Keymaster

    Hi griet,

    The issue on your website is because you are using some minification solution. It also combines all CSS into a single file and actually enqueues the file after your customizes colors are defined, which, as you might understand, overrides colors to theme default ones.

    To fix the issue, please check your minification plugin documentation for how to set the priority of stylesheet loading. (What caching/minification plugin do you use, just out of curiosity?)

    If the plugin doesn’t have such functionality, try using this code in your child theme‘s functions.php file modifying (rising) the priority number (the 200 in this example) to your needs:

    function child_theme_setup() {
      remove_action( 'wp_enqueue_scripts', 'Reykjavik_Assets::enqueue_inline_styles', 105 );
      add_action( 'wp_enqueue_scripts', 'Reykjavik_Assets::enqueue_inline_styles', 200 ); // Modify "200" here if it's not enough.
    }
    add_action( 'after_setup_theme', 'child_theme_setup', 100 );

    If it doesn’t help, please contact your caching plugin to provide solution on enqueuing the minified stylesheet earlier.

    Best regards,

    Oliver Juhas
    WebMan Design

    #20533

    Oliver Juhas
    Keymaster

    Hi griet,

    To give you more tips:

    I’ve checked your website again and it seems you are using https://wordpress.org/plugins/fast-velocity-minify/ plugin to minify the CSS. Looking at the plugin code, it seems there is no chance to override it’s minified stylesheet enqueuing priority due to it’s using PHP_INT_MAX constant to set it up (which sets this to maximum integer number your server can produce). Honestly, I’m not sure why they decided to do this and seems to be very contra productive and not overridable.

    However, you can try to load the theme inline styles (customized CSS variables) into your website footer, which should then override all styles loaded before them and thus it should apply your customizations without issues. Try this code in your child theme‘s functions.php file:

    function child_theme_setup() {
    	remove_action( 'wp_enqueue_scripts', 'Reykjavik_Assets::enqueue_inline_styles', 105 );
    }
    add_action( 'after_setup_theme', 'child_theme_setup', 100 );
    
    function child_theme_footer_styles() {
    	wp_print_styles( 'reykjavik' );
    }
    add_action( 'wp_footer', 'child_theme_footer_styles' );

    Best regards,

    Oliver Juhas
    WebMan Design

    #20535

    griet
    Participant

    Dear Sir,
    thank you so much for your quick reply and good help! Yes, when desactivating Fast Velocity Minify, everything is working well. I just do not understand why it was working well with the Reyjavik version I used before and not anymore with the new version.
    I did not learn yet how to use a child’s theme (I understand where it is used for and think it will be important to learn how to use this in the future), so the only thing I can do for now is putting FVM desactivated. Do you know another good plugin to minify CSS an JS which is free and functioning with the Reykjavik theme?
    Best regards

    • This reply was modified 6 months, 1 week ago by  Oliver Juhas. Reason: Making the post public as there is no sensitive information shared
    #20537

    Oliver Juhas
    Keymaster

    Hi griet,

    I just do not understand why it was working well with the Reyjavik version I used before and not anymore with the new version.

    Previously the theme was outputting only customization styles inline. So, even when the plugin loaded theme default styles after the customized ones, there was no style to override the customized ones.

    Since theme version 1.4.0 the customized styles are treated in much more flexible and simpler way using CSS variables. Theme tries to override default CSS variables values used in theme stylesheets by enqueuing these variables into HTML head after the theme stylesheets are loaded. But the plugin enqueues its minified stylesheet after anything else which makes it impossible for theme customized CSS variables to overrided default values. The issue is really in the plugin logic, they should definitely not use PHP_INT_MAX for loading assets, or they should allow to modify this value somehow.

    I did not learn yet how to use a child’s theme

    For this particular case the use of child theme is really very simple. You can download the sample one from https://github.com/webmandesign/child-theme (as stated in theme documentation). Read the description information of that GitHub repository for how to set up the child theme.

    Then just copy the code I’ve provided in my previous reply and paste it at the end of your child theme‘s functions.php file. Then just activate the child theme in your WordPress admin and you can keep using the Fast Velocity Minify plugin.

    Do you know another good plugin to minify CSS an JS which is free and functioning with the Reykjavik theme?

    I personally use paid WP Rocket plugin which seems to be working perfectly fine even with CSS files minification and Reykjavik customizations. However, please note you always have to be careful about CSS and especially scripts minification and with combining these files, no matter what plugin you are using.

    Best regards,

    Oliver Juhas
    WebMan Design

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.