[Plugin: 1-click Retweet/Share/Like] wp_enqueue_style & wp_enqueue_script called incorrectly
-
As the WordPress error messages says, “Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks.”
That mean these functions should not be called directly but like so:
function enqueue_my_scripts_and_styles() { wp_enqueue_style('thickbox'); wp_enqueue_script('jquery'); wp_enqueue_script('thickbox'); wp_register_script('postmessagejs', LACANDS_PLUGIN_URL .'jquery.ba-postmessage.min.js'); wp_enqueue_script('postmessagejs'); wp_register_script('lacandsjs', LACANDS_PLUGIN_URL.'la-click-and-share.js'); wp_enqueue_script ('lacandsjs'); wp_register_style ('lacandsnetworkpubcss', LACANDS_PLUGIN_URL.'la-click-and-share-networkpub.css'); wp_enqueue_style ('lacandsnetworkpubcss'); wp_enqueue_style('special-offers-style', get_template_directory_uri() . '/functions/css/special-offers.css'); } add_action( 'wp_enqueue_scripts', 'enqueue_my_scripts_and_styles' );
in la-click-and-share.php arount line 1033.
https://www.ads-software.com/extend/plugins/1-click-retweetsharelike/
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘[Plugin: 1-click Retweet/Share/Like] wp_enqueue_style & wp_enqueue_script called incorrectly’ is closed to new replies.