Quantcast
Channel: WordPress.org Forums » [Jetpack - WP Security, Backup, Speed, & Growth] Support
Viewing all articles
Browse latest Browse all 36995

Jeremy Herve on "[Plugin: Jetpack by WordPress.com] Share images, css & js not loading from subdomain."

$
0
0

Once you've checked the "Disable CSS and JS" option, you will be able to manually enqueue your own sharing js and css files.

Jetpack uses the WP_SHARING_PLUGIN_URL constant to build the path to load the libraries. You could change that constant by your own when re enqueueing the sharing libraries, like so:

function tweakjp_add_sharing_js() {
    wp_enqueue_script( 'sharing-js-fe', YOUR_OWN_WP_SHARING_PLUGIN_URL . 'sharing.js', array( ), 3 );
}
add_action( 'wp_enqueue_scripts', 'tweakjp_add_sharing_js' );

function tweakjp_add_sharing_css() {
    wp_enqueue_style( 'sharing', YOUR_OWN_WP_SHARING_PLUGIN_URL.'sharing.css', false, JETPACK__VERSION );
}
add_action( 'wp_enqueue_scripts', 'tweakjp_add_sharing_css' );

Viewing all articles
Browse latest Browse all 36995

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>