That snippet ‘works’ for me.
Is the script being printed at the bottom of the page? More specifically, does your theme call wp_footer
. All themes should, but not all themes do call wp_footer
which breaks plugins which rely on it.
For the record – you should not print scripts directly to the page. WordPress has a great API for handling JavaScript enqueing and dependency handling. See this codex page.
You may also find this question helpful too.
Related Posts:
- Automatically install wordpress plugin at theme activation
- How to run Two WordPress blogs with different themes and with single database and same content
- “Donate to this plugin” for WordPress.org Plugin Authors
- When coding a WordPress theme, where does the theme (i.e. the presentation) end and the plugin (i.e. the functionality) begin?
- How to show custom message once on plugin activation?
- How to notify users of blog updates a la Admin Plugin Update notifications?
- How can I force a “404 Not Found” error
- How do I configure WordPress to talk to a Microsoft SQL Server database?
- How to set “with_front’=>false” to a plugin-generated cpt?
- plugin shortcodes not working on custom theme- unsure how to fix
- Is there a plugin that allows a user of your site to get an email from you with an attachment?
- PDF download – use wordpress functions
- Code in theme functions.php faster than with a plugin?
- Multiple Domains with Single WordPress Install
- API to filter new user registration $POST data?
- Set cookie then immediantly refresh the page
- Is there a plugin that makes extnernal links open in new window, BUT [closed]
- How to remove duplicate Custom Fields?
- Calling a plugin in theme development
- Installing WordPress only for a separate page – ‘mydomain.com/blog’
- ‘Customize’ button in admin bar for CSS
- Saving Custom Post types and fields to a custom table
- WooCommerce shop page orderby [closed]
- How to create user groups and allow custom posts and plugin modify/access to specific group?
- How can I disable the multisite feature of WordPress 3.0?
- How to translate __(”) strings in admin [closed]
- Breadcrumb NavXT plugin – exclude ‘home’ page
- WordPress comments not appearing in blog posts, likely because of Redux template. Could I fix this with a plugin that adds a comment form as a block? [closed]
- trying to get user info in plugin
- How to delete page by deactivating plugin
- External Domain on WordPress Multisite
- Customize permalink wordpress category id
- Take input from form and pass it to function using a wp-plugin
- Translation for the plugin using redux framework does not work
- Re use the list table for a custom post type on another page
- Can we have an ‘Update metadata’ button in Image Gallery for all image instances?
- Stop Plugin Enumeration [closed]
- Customize The Events Calendar to Include an Option to Expand for More Events Listings
- Hook into existing tinyMCE button
- Load Javascript from Plugin in One Page Only?
- How to embed .mp4 videos in a WordPress post?
- Detailed form plugin, with ability to export to excel etc. OR edit PDF live? [closed]
- How to remove js ui library added by default by wordpress
- What is the best way to cache pages on WordPress
- Sticky option for custom post types without using custom fields or plugins
- Let users sell video in my website [closed]
- How to find the list of custom post type where logged in user is author
- Stop wordpress from requesting external jquery from googleapi
- Regularity of Checking for plugin updates? [duplicate]
- how do i change my website facebook login button to another text immediately user login? [closed]
- WordPress Social Sharing Icons – Custom Placement
- “Deregister” plugin from frontend or specific pages?
- Using meta_query in a WP_Query not working for numbers properly
- Action on WordPress Install
- reCAPTCHA on page template without plugin
- get current page number with wp_link_pages()
- Some images on WordPress site are suddenly gone
- What is the best way to make a custom page from a plugin?
- Setting text widget to one page only
- How to add captcha to publish widget
- Permalinks and pagination are not working in WordPress with WP e-Commerce plugin
- Searching a tab/space delimited text file based upon form criteria and returning a ‘record’ into a word press results page
- How to validate custom fields in Quick edit/bulk edit?
- apply_filters(woocommerce_get_item_data, …) Causing errors when adding to cart
- How to add logo to a WordPress Custom Plugin?
- Using OR Condition with facetwp facets
- insert og image link in wordpress post
- How to copy the all WordPress media items to another custom plugin folder?
- Is it possible to place a WordPress widget into the main page layout?
- Plugin updated pushed with git break site
- Forbidden 403 Access to this resource on the server is denied
- Error on plugin activation and creating new page
- Child theme modifications not showing up
- Moving a few select DB tables to a new WP instance
- Showing different js file for different theme in wordpress customizer api
- Function settings_fields() not recognized (Uncaught Error: Call to undefined function settings_fields())
- how to make settings page for woocommerce plugin?
- what’s different between wpdb->prefix and table_prefix
- User Following System
- How to get the total count of Favorite/Favorited authors
- Top authors or top categories by post views?
- Can Hosting affect a plugin from working properly?
- WP default file upload hook not working if used in a plugin
- My own metabox checkbox plugin only saves the last value I’ve checked
- Need help getting a certain value out of a multi dimensional array
- Plugin’s required JS not being inserted in my theme
- Extend WordPress Search
- WordPress internationalization + domains
- Display alt text as tool tip on page
- Gravity Forms Salesforce field mapping for custom objects
- Plugin:Read More Right Here , How to change the name (more…) to Read More
- How do I output user_registered time in my correct timezone?
- Ajax in Plugins: returns the whole page
- how to search through plugin in wordpress cimy-user-extra-fields?
- Looking for Plugin that displays Facebook group’s photos [closed]
- Publishing tweets from wordpress [closed]
- How to change prices per number ordered in WooCommerce [closed]
- How do I put a word-press blog into my static site without installing wordpress on server?
- Oxygen plugin wordpress stuck in loading sequence forever when trying to edit a page [closed]
- plugin doesn’t retrieve data from database