Download the script (or add it via npm > bower to your theme), wp_enqueue_script()
it at the wp_enqueue_scripts
hook and then simply add/enqueue another (your custom) script where you add the contents of the demo index.html file:
( function( $ ) {
$( "img" ).photoResize( {
bottomSpacing: 15
} );
} )( jQuery || {} );
Related Posts:
- url – ajax loaded but no JS
- WP Customizer compare and set a value via javascript
- Callback After WordPress Customizer Complete Loading
- “JQMIGRATE: Migrate is Installed” How do I find the problem code? [duplicate]
- Referrer URL with jQuery or Javascript – Cache & Referrer URL Issue
- Why doesn’t jQuery use $, and how can I get it do so (GLOBALLY)?
- Create special WordPress slideshow with “jquery.cycle.all.js”
- Using Foundation 5 in WordPress Administration Area
- I have an old version of jQuery showing up. How do I figure out where it is coming from?
- Plugin Scripts no loading on options page
- Close Fancybox, sumbit form data and redirect
- Ajax Validation for reCaptcha
- How to enque js script in footer that are not in .js file?
- Loading scripts on a single page plants the script in the footer
- How to change background image from WordPress Gallery
- Properly embed javascript into WP (using function.php) – doesn’t work?
- Search input area autogrow – how?
- Using jquery and javascript in WordPress
- WordPress Rotating Background Images
- Nested Gallery Shortcode INTERMITTENTLY working
- Disable Cloudflare Rocket Loader for jQuery javascript and make it load first
- Get value of selected option in select field in a WordPress form
- How to keep HTML form field that is conditional hidden with javasript hidden after page reload?
- Accessing javascript in multiple files [closed]
- How to change the text of the “You are about to permanently delete these items…” alert message when deleting media from the media library?
- Unable to get my javascript to work on my website – what am I doing wrong?
- Issues loading Jquery on WordPress website
- Required radio button does not validate in form, when clicked through Javascript/jQuery
- jQuery selectable() function won’t work in wordpress
- oEmbed Video in Modal
- Custom AJAX form not working async
- Multiple Media uploader output to input
- AJAX Success Function using JS substr() fails in WP 4.1 vs 4.0
- Using WP functions inside javascript
- How to add external remote JS source to Gravity Forms?
- Blur.js with WordPress – Enqueued, but server not finding file
- Is it OK combined wp-include js, jquery, css? [closed]
- Including Older Version of jQuery for IE7/IE8
- Parse wordpress blog data using json api and ajax
- Screen Options JavaScript Code
- Problem adding MP3 attachments to a jPlayer playlist
- Is there some jQuery conflict here?
- How To Include JavaScript Files Only In Single Posts?
- wordpress before or after javascript problem
- Theme has superfish – how to add supersubs?
- Ajax page load in wordpress the right way?
- Jquery not working
- A carousel slideshow plugin in JavaScript
- Absolute path to stylesheet_dir/images/my_img.jpg does not work?
- Best way to add some custom javascript using jquery to a child theme
- JS behavior differs depending on page tree [closed]
- I am trying to Implement a Code that is Working in my previous page but not working in WordPress for some reason
- How to use $ with externally loaded javascript
- Add JQuery As Code Snippet
- Theme customisation – how to store javascript externally when it utilises php variables?
- Getting click on item to open closest relevant element (popup) with jQuery
- Form validation before submitting
- How to make JQuery load on top of head tag before everything
- jQuery for Fade Preload Causes My Site Favicon to Disappear from Tab of Browser
- Show and hide element when URL contains certain section of text?
- Defer Parsing of Scripts
- Customizer add query to preview URL
- Orderby post__in Not Working Correctly?
- Get ajaxForm response value
- why does so many javascript libraries are loaded along with my website?
- Why does my media selection script write to ONLY the first input field?
- Site images are fixed in front of my site content [closed]
- JavaScript code do not works on online server
- onclick jquery function not working in wordpress header file [duplicate]
- Notify user we would like them to clear their cookie. Provide a working button to clear cookies for user
- Modify the href attribute of tag dynamically in WordPress
- JQuery toggle in Visual Composer
- Add a jQuery snippet for sepcific user role
- Bootstrap with separate js File
- jQuery not working for media uploader
- Call full image url instead of stylsheet directory url in JS for Infinite Scroll Function
- Adding scripts before plugins scripts
- Move jQuery on *top* of footer
- How to toggle custom WP archive list
- comment-reply.js disables any other form javascript
- WP Media Uploader modal conflicts with Bootstrap modal
- JQuery and Javascript to pan image
- jQuery search function not running in WordPress but running locally (fiddle)
- Masonry – Can’t Find Variable imagesLoaded
- How to blur the_post_thumbnail() via blur.js (jquery)?
- Display images from JS?
- JQuery Login Dropdown not functioning in theme
- Custom Javascript not working? [closed]
- How to get this jQuary script working?
- Youtube Iframe Api play one video at a time
- Javascript function to switch out images
- How to add JS snippet before closing tag?
- Enqueue javascript that inserts custom php widget into jQuery-constructed div
- Retrieve customizer value using ajax or customizer api and print the value in theme
- Displaying contents of a tab
- Disable drag metaboxes, create many functions using js not to work!
- How to deregister scripts all at once
- Uncaught TypeError: undefined is not a function (shortcode-box)
- Running javascript in a child theme. Works in jsfiddle
- How to block action if post is “dirty”?