Hot answers tagged

9

Each of the files you have mentioned are theme files. When you upgrade WordPress itself, it will not touch any themes (or plugins) you have installed, whether or not you have modified them. If this was a theme you created yourself, then you have no worries at all. However, if this was a theme created by someone else, for example a WordPress default theme, ...


2

Problem The Short Version The problem isn't how you're using those scripts or where you're placing them - it's how the authors of those scripts wrote them. The Long Version Your "superfish" script which controls the functionality of your navigation menu is throwing errors because $.browser is undefined. While $.browser was deprecated more than 3 years ...


2

Here's one demo suggestion: add_action( 'admin_enqueue_scripts', function() { wp_enqueue_script( 'my-script', '/my-script.js', ['underscore', 'backbone'], '1.0' ); wp_add_inline_script( 'my-script', 'alert("hello world");' ); // Add our template if( function_exists( 'wpse_add_inline_tmpl' ) ) wpse_add_inline_tmpl( $handle =...


1

Copying from the answer here regarding variable scope Variables inside a function are only available inside that function. Variables outside of functions are available anywhere outside of functions, but not inside any function. Because of that, you need to add your $translations array within the kvkoolitus_load_comment_validation function, like ...


1

Take a look at a plugin called Better REST API Featured Image. It adds the featured image URL to the original API response.


1

You need to wrap your text with <?php and ?>. Like this: <?php function my_scripts() { wp_enqueue_script( 'jquery' ); wp_register_script( 'parallax', get_template_directory_uri() . '/parallax.js', array( 'jquery' ), NULL, true ); wp_enqueue_script( 'parallax' ); } add_action( 'wp_enqueue_scripts', 'my_scripts' ); ?> Otherwise, ...



Only top voted, non community-wiki answers of a minimum length are eligible