If you check your console for errors as @patnz suggested, you’ll likely see that $ is undefined. This is because WordPress loads jQuery in noConflict mode. Try this instead:
<script>
jQuery(document).ready(function($) {
$("a.fancy").fancybox({
'transitionIn' : 'elastic'
});
});
</script>
Related Posts:
- pass object/JSON to wp_localize_script
- How to alter the text of the post “Excerpt” box label in WordPress post editor?
- What is the best practice for customizing a plugin’s JavaScript/jQuery?
- How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
- How to Change CSS Variable value in Theme Customizer Live Preview
- WordPress Google Maps in Custom Theme
- wp_enqueue_script being ignored in custom theme
- Getting jquery to work with custom theme
- Adding wp_enqueue_media(); causes problem
- How to correctly add JQuery in a WP theme?
- Toggle Sidebar Display
- Including Javascript options
- Unhook jQuery from WooCommerce via `functions.php`? [closed]
- Fancy-box Esay wordpress plugin fails to work on Multilingual site
- WP 3.1 upgrade breaks AutoFocus+ theme
- Difficulty loading jQuery with wp_enqueue_script
- jQuery not available to other scripts
- My javascript jquery won’t work?
- How to: JQuery multiple wordpress media uploader buttons in the same options page?
- Post thumbnail to append post content via ajax click event
- Would to use AJAX to get an option from the database and use it in a jquery setup or is there an alternative to consider?
- Using page-id-{ID} from body_class() in local dev, versus live staging
- My jQuery is enqueued properly. So why isn’t it working?
- Custom theme, contact form 7 & fast secure form doesn’t work
- Javascipt issue on custom theme
- How to make javascript work on theme options page
- JQuery undefined and Stylesheet loads in bottom along with js files
- Weirdness in jQuery supplied with WordPress
- jQuery from parent theme loaded with many other scripts in a single min.js file
- Trouble in enquing all js files under certain directory
- How do I implement jPanelMenu?
- loading javascript after jquery is loaded
- MapPress Easy Google Map in Jquery Tabs Problem
- I don’t think WordPress is loading jquery or bootstrap js
- how can i remove js file from my footer in wordpress
- How to properly use AWS SES for a contact form?
- Embedding CodePen Calorie Script – jquery error
- How to load jQuery with Ajax in WP version 5.3.2?
- How to enqueue scripts properly with ES6 webpack?
- Infinite scroll without plugin using ajax
- change background image on scroll
- how to add jquery to wordpress
- jQuery conflict in WordPress, works fine in HTML
- How would I get this to work – send to post from thick box
- FitVid not working for iframes on particular theme install
- Enable WP to accept standard jQuery code embeding between the tags [duplicate]
- WordPress custom jquery not found
- Passing a location-dependent array via wp_localize_script within a shortcode
- enqueue script if page is not equal to
- Set start page depending on screen width [closed]
- WordPress Subpages Fancybox Trouble
- Theme now uses require.js and enqueue script no longer works
- can’t add EVENT LISTENER to a element
- jQuery Snippet Not Working on WordPress Site [closed]
- WP Customizer get control value on change
- Execute javscript when theme customizer loads (autosave issue)
- WordPress Includes mejs 404 error
- How to add posts to custom menus?
- Best practice way to implement custom sections into a WordPress theme
- How to customize wordpress login/register pages?
- Page attribute template dropdown not displayed even the syntax is correct
- When developing a distributable Theme, does it HAVE to be “inheritable”?
- De-registering parent style sheet css recommended?
- inserting custom li class to wp_list_pages
- Theme check: Missing a text-domain
- Free starter theme to make mobile websites? [closed]
- WP Customize refresh problem
- Following Web Performance Optimization techniques to output static and dynamic css
- Internal Stylesheet in WordPress Theme development
- How to support letting users add their OWN logo to a custom theme?
- Does code in function.php differ from theme to theme
- How can I optimize this code? [closed]
- Issue on Getting Custom post type Thumbnail’s URL
- Forms won’t submit
- How do I provide for multiple crops of the same image in a theme?
- Why WordPress AJAX returns undefined however it works fine when I add static url instead of dynamic function?
- Twenty Seventeen Pages Loop
- How to add pages in wordpress using codes?
- How does the loop know which post to view?
- How to remove permalinks links presents in each page of my site?
- How to use multiple check-box values to work in a function and insert values in database
- How to make a function occurs for one time?
- How to create a robust and logic class naming system in WordPress theme developing?
- How to enable admin to upload multiple images to support header carousel slider theme in WordPress?
- how to change footer content for certain pages only
- function ‘theme_settings_page’ not found
- Should I use template files or just use conditional tags in index.php?
- Is there a way to create sections under “Colors” panel in the Theme Customizer?
- Need help with adding custom wordpress menu and sub-menu
- get currently showed author ID in theme functions.php
- How to load mediaelement.js in theme template?
- WordPress Blog Page displaying nothing
- Full width thumbnail
- using theme check plugin to remove waring and errors from my theme
- Suppress the_content filter in a nested loop
- URL conflict with a ‘Single Page Layout’
- loading custom.js file after jquery is loaded
- How to determine if it is legal to remove credit link from theme?
- Display recent posts on front page
- How to Enable Hot Module Replacement with Webpack