Tag Info

New answers tagged

0

This is old but for anyone else reading this question, don't use github as it won't work. <?php /** * Plugin Name: Add JQuery Chosen Quickly * Plugin URI: http://wordpress.stackexchange.com/questions/85824/ * Description: Test/Add chosen to site without adding any files * Version: 1.0 */ function enqueue_chosen_jquery() { wp_register_style( ...


0

I came up with two wrapper functions: function wp_enqueue_cdn_script( $handle, $src_cdn = false, $src_local = false, $deps = array(), $ver = false, $in_footer = false ) { $cdnIsUp = get_transient( $handle . '_script_cdn_is_up' ); if ( $cdnIsUp ) { wp_enqueue_script( $handle, $src_cdn, $deps, $ver, $in_footer ); } else { ...


0

You can simply do it like this: // shortcode hook add_shortcode("make-me-a-map", "create_new_map"); // shortcode callback function style_my_new_map() { global $new_map_called_for; if ($new_map_called_for == true) { wp_register_script('make-a-new-map', get_template_directory_uri() . '/js/new-map.js', array('jquery'), '0.1', true); ...


1

Your question is general, so I cannot answer it in details. If the parent theme enqueues some styles using get_stylesheet_directory_uri() in the path they won't be available in child theme. Then you should enqueue lacking stylesheets in your child's function.php using get_template_directory_uri() which will point to the parent theme directory. Some ...


0

Your problem likely stems from using the WordPress functions incorrectly - there is probably no need to debug any Javascript to solve the issue. Carefully review the Codex entry for wp_enqueue_script(). I assume this is what you are attempting to accomplish. In your theme's functions.php file: function wpse178370_enqueue_scripts() { wp_enqueue_script( ...


0

For what it's worth - I recently ran into this problem with the editor disappearing with wp 4.1 after a site migration. The issue happened to be that "accessibility mode" (The link under screen options in the widget editor) was turned on.


2

IMHO, I still think that loading scripts and styles directly in the header is bad practice as it is always a problem removing them and loading them coditionally. The best way to work around this is to create a [child theme] and then copy header.php to your child theme. Wordpress will load your child theme's header instead of the parent theme's header. You ...


1

What you might do is check the status of the scripts you are trying to enqueue after doing so. Also, be sure to enqueue things inside of an action. e.g. function do_my_enqueue_scripts() { wp_register_script('isotope', get_template_directory_uri() . '/js/jquery.isotope.min.js',array('jquery'),'',true); wp_enqueue_script('isotope'); } ...


5

From http://codex.wordpress.org/Function_Reference/wp_register_script: <?php wp_register_script( $handle, $src, $deps, $ver, $in_footer ); ?> This means you need to add the $deps and $ver values to wp_register_script() in order to set $in_footer. Like this: wp_register_script( 'justifiedGallery', ...



Top 50 recent answers are included