wp_enqueue_scripts and every galley plugin won’t work
-
This problem followes me since several month, and I don’t know how to solve it. When I try to add some gallery plugin, it wont’t work and wordpress gives me that message:
Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in C:\xampp\htdocs\bib5\wp-includes\functions.php on line 3996
and consola (about e.g. galleria plugin):and consola (there is with galleria plugin):
TypeError: jQuery(…).galleria is not a function
<script type=”text/javascript”>jQuery(document).ready(function(){ jQuery(“#amw_g…
/Becouse I have this problem third time I think, I do something wrong. Maybe I add something incorrectly in function.php. Maybe it’s something with wp_register_script and enqueue. I try find answer, but still I don’t what exactly. Sometimes even if I delate everything from function.php, I still have this php error message. So please, if you can, take a quickly look at my function.php, and say me what I could to do wrong…
<?php /* function my_admin_bar_init() { remove_action('wp_head', '_admin_bar_bump_cb'); } add_action('admin_bar_init', 'my_admin_bar_init'); /*menu*/ function register_my_menus(){ register_nav_menus( array( 'main' => __( 'Main Menu' ), 'quickMenu' => __( 'Quick Menu' ), 'archiwum' => __('Archiwum'), 'galeria' => __('galeria') ) ); } add_action('init', 'register_my_menus'); require_once ('inc/wp_bootstrap_navwalker.php'); function addStyleAndScripts_init(){ wp_register_script('jquery-js', 'https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js', false, '3.1.0'); wp_enqueue_script('jquery-js'); wp_register_style('core', get_bloginfo('template_directory'). '/css/core.css','core'); wp_enqueue_style('core'); wp_register_style('img', get_bloginfo('template_directory'). '/css/img.css','img'); wp_enqueue_style('img'); wp_register_style('bootstrap-css', get_bloginfo('template_directory'). '/bootstrap/css/bootstrap.min.css'); wp_enqueue_style('bootstrap-css'); wp_register_script('bootstrap-js', get_bloginfo('template_directory'). '/bootstrap/js/bootstrap.min.js'); wp_enqueue_script('bootstrap-js', array('jquery-js'),null,false); wp_register_script('bootstrap-font', get_bloginfo('template_directory'). '/bootstrap/font/bootstrap-glyphicons.tiff'); wp_enqueue_script('bootstrap-font', array('jquery-js'),null,false); } add_action('init', 'addStyleAndScripts_init'); ?>
- The topic ‘wp_enqueue_scripts and every galley plugin won’t work’ is closed to new replies.