This topic has 10 replies, 3 voices, and was last updated 6 years by Radu.

  • Author
  • #176757
     alexlii
    Participant

    Hello,

    When we create a page, the Visual composer will connect google fonts resource automatically, since we are blocked in China to access google fonts, it will caused delay.

    We are use some plugin like Remove google fonts to disable that connection, but it does not work anymore in WordPress 4.8.

    It would be great appreciated if you can let me know how to remove that connection in Visual composer.

     

    Thanks.

     

    Alex

    #176759
     Kieran_SQ
    Moderator

    Hi,

    Please try the below snippet in your KLEO Child theme’s functions.php by going to WP Admin > Appearance > Editor > KLEO Child > Functions.php

    COPY CODE
    // Remove Google Fonts from being called in page editor
    add_action( 'vc_after_init', 'vc_after_init_actions' );
     
    function vc_after_init_actions() {
         
        // Remove VC Elements
        if( function_exists('vc_remove_element') ){ 
             
            // Remove Google Fonts Custom Heading
            vc_remove_element( 'vc_custom_heading' );
             
        }
         
    }

    Thanks,

    Kieran.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #176778
     alexlii
    Participant

    Thanks, but it does not work for us. we are running wordpress Multisite 4.8, so, I copied your code into Kleo-child function.php, and upload it with FTP.

    the reason why it does not work might be related Multisite? or what did I wrong?

    Here is screenshot for your reference: http://prntscr.com/gxy59o

    Alex

    #176884
     Kieran_SQ
    Moderator

    Hi,

    Sorry to hear this is not working for you, it worked for me on a live and local site. I will ask one of our developers @radu to take a look at this for you as they will have a much better insight into the intricacies of multisite.

    Thank you for your patience,

    Kieran.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #176957
     Radu
    Moderator

    Hi,

    Finally figured our .. some google fonts are loaded thru CSS with include and cannot be dequeue with wp_dequeue_fonts

    So you will have to delete the highlited code from those files

    1. /wp-content/plugins/js_composer/assets/css/js_composer_frontend_editor.min.css
    2. /wp-content/plugins/js_composer/assets/css/js_composer_backend_editor.min.css

    You can ask visual composer if they are in plan to add a option ON/OFF google fonts or maybe a better solution.

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #177092
     alexlii
    Participant

    Thanks.

    It works at frontend, but it does not work at backend, once I create a new page, it will still keep connecting to google fonts.

    Yes, I did wrote them before, and rewrite to them just now(https://codecanyon.net/item/visual-composer-page-builder-for-wordpress/242431/comments).

    Thanks so much.

    Alex

    #177133
     Radu
    Moderator

    Hi,

    Check also those files, those have link to the fonts.googleapis.com :

    1. /wp-content/plugins/js_composer/include/templates/shortcodes/vc_custom_heading.php
    2. /wp-content/plugins/js_composer/include/templates/shortcodes/vc_gitem_post_author.php
    3. /wp-content/plugins/js_composer/include/templates/params/vc_grid_item/shortcodes/vc_custom_heading.php
    4. /wp-content/plugins/js_composer/include/templates/shortcodes/vc_gitem_post_data.php

    In all those files a wp_enqueue line exist with the same font and code apparently, comment them.

    Suggest to vc team to add an option or a filter that prevents google fonts to load.

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #177359
     alexlii
    Participant

    Hello,

    Thanks, I comment all that lines, actually, I comment another one in a file named: vc_ui-fonts.less.

    and please check here:http://prntscr.com/h0fjx2

    but it still does not work at backend, it is really troubled, I wrote to VC team twice before, but no reply yet.

    It would be great if you can wrote them too on behalf of Seventh queen theme developer, thanks a lot.

    Alex

    #177510
     Radu
    Moderator

    Hi,

    Will speak with the core developer about this. but most sure they will reply to you when they have availability.

    If you have a VPS you can try to do a workaround, from the host file of the server set an artificial 200 response but empty response from the google fonts hosts

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #179240
     alexlii
    Participant

    Hello,

    If you have a VPS you can try to do a workaround, from the host file of the server set an artificial 200 response but empty response from the google fonts hosts

    any article for reference? thanks for your instruction.

    Alex

    #179270
     Radu
    Moderator

    Hi,

    There is no article, you should root from your hosts file of the server the font.googleapis.com to a server that says 200 , i don’t have exact steps for that, this is only a idea

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 11 posts - 1 through 11 (of 11 total)

The forum ‘Plugins questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?