[Resolved] Flickering sidebar and topbar

Home Forums Support [Resolved] Flickering sidebar and topbar

Home Forums Support Flickering sidebar and topbar

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #687058
    Halil

    Hi,
    I am having heavy flickering problem with my site on chrome and edge (edge is lesser flickering)
    I have attached a video link.

    I tried to disable almost all of the plugins, tried on 2 different laptops, same result.
    https://www.youtube.com/watch?v=6oDvQsecptk

    What can be the reason?

    GeneratePress 2.1.4
    GP Premium 1.7.2
    #687275
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    This is happening because of your icons.

    You’re loading Font Awesome in the footer, which means your page loads before the icons load.

    If you load Font Awesome in the <head> instead, the flicker will go away.

    #688017
    Halil

    Thanks for help Tom, but could u pls describe what to do to load font awesome in the head? I really dont know how to do it and it is beyond my knowledge, that’s all started after changing setting in gp regarding font awesome.

    I tried severa methods but couldnt achieve it.

    #688167
    Tom
    Lead Developer
    Lead Developer

    How are you adding Font Awesome? Function or plugin?

    #688252
    Halil

    I am not using any plugin for font. While ago, I have changed the setting in GP to use minimal fontawesome, after that change in settings it’s gone and fontawesome is now being provided thru bootstrapcdn.

    In the functions.php I see nothing regarding fontawesome. What should I do?

    #688253
    Halil

    and if posible I’d like to serve it from my own web server, cause I am already using another cdn.

    #688722
    Tom
    Lead Developer
    Lead Developer

    How is it being served through bootstrap cdn? There must be a function or plugin added to your site which is adding it. We need to find out how it’s being added so we can adjust those settings to load it in the <head>.

    #688803
    Halil

    Well I really dont know, after changing the settings for fontawesome in GP it started serving thru bootstrapcdn?
    Never seen that before.

    And I couldnt see any code referencing bootstrap cdn in the functions.php.

    Would u like to have a look at it? I can add you as admin?

    #688918
    Halil

    I think I found out which plugin it is.
    I have disabled it.

    What should I wrote to functions.php to enable load fontawesome in the head?

    #689063
    Tom
    Lead Developer
    Lead Developer
    #689129
    Halil

    although it seems easy to edit, I couldnt achieved that. Here is the code that plugins load fontawesome from local server. I have loaded all the fonts into my theme/fonts folder and css to theme/css. It now loads font awesome locally. How can I edit this code to load it in the head?

    add_action( 'su/assets/register', function() {
    	wp_deregister_style( 'font-awesome' );
    	wp_register_style( 'font-awesome', get_stylesheet_directory_uri() . '/css/font-awesome.min.css', array(), '4.7.0', 'all' );
    } );
    #689247
    Halil

    Tom,
    with the following code, I have loaded font awesome and hopefully it loads in the head? Header stopped flickering but sidebar still flickers.

    
    add_action( 'su/assets/register', function() {
    		wp_deregister_style( 'font-awesome' );
    	} );
    
    add_action( 'wp_enqueue_scripts', function() {
    
    		wp_register_style( 'font-awesome', get_stylesheet_directory_uri() . '/css/font-awesome.min.css', array(), '4.7.0', 'all' );
    
    		wp_enqueue_style( 'font-awesome' );
    
    	} );
    
    #689486
    Tom
    Lead Developer
    Lead Developer

    It looks much better to me now. There will always be a small “flash” as the icons load, which is the same with any custom font (icon or text).

    Without doing a hard refresh, the icons don’t flash at all for me anymore ๐Ÿ™‚

    #689778
    Halil

    thanks.

    #690065
    Tom
    Lead Developer
    Lead Developer
Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.