You need to change the enqueueing part to this:
function skinsave_2016_slider() {
wp_enqueue_script( 'skinsave_2016-slider-js', get_bloginfo( 'template_url' ) . '/js/slider-js.js', array(), null, true);
}
add_action('wp_enqueue_scripts', 'skinsave_2016_slider');
The problem was your function content_url()
returns http://yourdomain.com/wp-content
, and not the URL of the template. get_bloginfo( 'template_url' )
does return http://yourdomain.com/wp-content/themes/yourthemeslug
.
The second version you tried you wrote bloginfo('skinsave_2016');
, where ‘skinsave_2016’ is not a valid argument.
Stick with the first version though, because it is the right way.
Also be sure your theme calls wp_head()
and wp_footer()
!
Related Posts:
- Solutions for generating dynamic javascript / CSS
- Any alternate TinyMCE4 themes / subthemes?
- Whats the safest way to output custom JavaScript and Css code entered by the admin in the Theme Settings?
- How to add material design css in wordpress and woocommerce
- How can I wrap all blog posts image with
- White screen when attaching css to function.php
- WordPress theme resource won’t load over VPN
- theme-independent CSS/JS files
- How to reuse parts of WordPress site e.g. header, footer, part of header for multiple WordPress sites?
- What is The Best Way to Make Parallax header effect for wordpress theme ?? pure CSS or using JavaScript? [closed]
- Does the functions.php file ever get called during an AJAX call? Debug AJAX
- How to add CSS class to custom logo?
- theme path in javascript file
- Understanding wp_add_inline_style
- Proper, exhaustive documentation for wp.editor etc
- Trigger Customizer saving process with Javascript only
- Why max-width:97.5% on content images?
- add generated stylesheet from parent theme after child-themes style.css
- why does twenty eleven theme mix up the css measurement units?
- Setting up partial Right-to-Left admin interface
- Adding inline styles from a widget
- Can’t edit style.css in subdirectory of my theme?
- Adding dashicon fonts to the admin of pre 3.8 installs
- How to Handle CSS for Multiple Header header.php Files?
- Changing the entire control choices using wp.customize with JavaScript
- How to Change CSS Variable value in Theme Customizer Live Preview
- Move my theme style.css into a folder
- Enqueued Stylesheets Effecting Admin Styles
- There’s an image named g.gif somewhere in my WordPress site
- wp_head() not inserting the default stylesheet style.css
- How to highlight the current page in the nav menu?
- First completely customized theme, where should I start?
- Root Sage theme styles are not working!
- WordPress Customizer Control with React
- How to configure wordpress to work with Vuejs with SSR and without hashbang
- WordPress 5.8 update problem custom theme styles are overridden by core styles common.min.css
- CSS won’t style output of wp_nav_menu() correctly
- Where is definied the theme location for the main menu in a WordPress template?
- How to correctly add JQuery in a WP theme?
- Is it necessary to prefix every css class in a theme framework?
- current-menu-item class not working
- Weekly background code not working
- Including Javascript options
- How do the default themes reference style.css?
- Multiple Page Templates & CSS
- JavaScript Change focus to password field login page being reset
- How to make Isotope and WordPress work together?
- Single page site with history.js
- Font Awesome 5 Free – far working but fas is not? [closed]
- How remove render blocking css from wordpress when you build a theme?
- How to: JQuery multiple wordpress media uploader buttons in the same options page?
- What is the meaning of WordPress’s recommended css classes and where are they applied?
- Redirect to another page using contact form 7? [closed]
- How to i style the elements from the TinyMCE
- Using page-id-{ID} from body_class() in local dev, versus live staging
- Custom image size vs CSS sizing
- How to rotate every letter in a title
- theme style is applied on the dhasboard rather than the website
- SVG in list-style-image breaks when adding fill
- How to style bootstrap container in wordpress theme?
- CSS added through customizer neglects the need of a child theme?
- How to override template files in parent theme?
- LESS not working in WordPress [closed]
- Place title (in correct place) above image with opaque background [closed]
- multiple html/css files for wordpress theme?
- CSS preprocessor file messed up after compiled
- Why I obtain different visualization when I run the website on my local machine and on remote server?
- my single.php is mixup on some post for no reason
- How to use the _S framework
- getBoundingClientRect() showing different values on load vs scroll
- style variations hurt the editing performance
- wordpress script_loader_tag in function.php
- How to diagnose wp-env environment problem
- Why nav_menu_css_class doesn’t work with apply_filters?
- Default customizer colors aren’t displayed outside of the preview
- Is there a way to add classes to a page when using a Gutenberg reusable block as page layout?
- WordPress doesn’t load css, image and js files after moving local installation folder
- How to generate a rtl.css file for themes?
- Load multiple css simultaneously using functions.php
- overlay post title over post’s featured image
- Customizer Image-Picker Preview Not Working
- Change site title color on individual pages
- Mobile view logo background colour in wordpress
- Enqueue Stylesheets After Theme’s “rtl.css”
- WordPress 3.5 + Foundation 5 not working on IE9
- Theme customizer live preview JS- Trying to bind to an html image url without luck
- Any disadvandages if I style the wordpress align classes without img and .wp-caption prefix
- adding navigation to genesis themes
- wp_deregister_script was called incorrectly
- Using wp_enqueue_script with social media buttons?
- Alternating CSS classes for dynamic content [closed]
- Header is not showing full width
- How do I middle-align my header menu items in WordPress [closed]
- How to resize video lightbox popup in wordpress? [closed]
- How can I get rid of the distance when I’m using list-style-type: none? [closed]
- Theme now uses require.js and enqueue script no longer works
- WP site makes mobile browser crash for high memory usage
- HTML to WORDPRESS [closed]
- jQuery Snippet Not Working on WordPress Site [closed]
- Image and font support missing in editor when deploying theme remotely