Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter hbk747

    (@hbk747)

    Another question I had was that I have the standard interface activated for posts and the position I have chosen is Bottom of the Content. However the social share buttons appear after the excerpt (which is at the top of the page) and after the post. Please take a look at this screenshot:

    https://ibb.co/RkN5ptZb

    The social buttons are below the excerpt which is causing a longer load time. I want to disable these but keep the ones at the bottom of the post active. Right now I have deactivated the social buttons copletely.

    Plugin Contributor Rajat Varlani

    (@the_champ)

    To get rid of the unused message, try adding following code in the functions.php file of your active WordPress theme.

    /**
    * Initialization
    */
    function heateor_sss_custom_init() {
    add_action( 'wp_enqueue_scripts', 'heateor_dequeue_js_css' );
    }
    add_action( 'init', 'heateor_sss_custom_init' );

    /**
    * Dequeue the CSS and Javascript files of Sassy Social Share
    */
    function heateor_dequeue_js_css() {
    global $post;
    // put your condition here
    wp_dequeue_style( 'heateor_sss_frontend_css' );
    wp_dequeue_script( 'heateor_sss_sharing_js' );
    }

    This will prevent the Javascript file from loading on your website.

    To check why the buttons are appearing more than once, post a screenshot showing the page-groups you have selected in the Placement option in the Standard Interface section at the plugin configuration page.

    Thread Starter hbk747

    (@hbk747)

    @the_champ

    Hello, I will try adding the code.

    Here is the screenshot:

    https://ibb.co/21YbwzxL

    Plugin Contributor Rajat Varlani

    (@the_champ)

    Icons are appearing twice because the_content filter is being used once with the excerpt and again after the end of the content of the web page. This filter is responsible for the rendering of the icons. I suggest you modify the theme to not use the excerpt at the beginning of the main content OR use it as it is now. Multiple share bars won’t impact the loading of the web page.

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

The topic ‘reduce unused javascript’ is closed to new replies.