In order to use $ inside your script (You only need to change the wrapper of your script), use the following wrapper.
jQuery(document).ready(function($) {
// $() will work as an alias for jQuery() inside of this function
});
Make sure you enqueue jQuery in one of your plugins or theme using wp_enqueue_script('jquery');
Read more on Codex
http://codex.wordpress.org/Function_Reference/wp_enqueue_script
The following article contains useful tips on using jQuery with WordPress.
http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/
Related Posts:
- Confirmation box when submitting post for review
- Ajax Load More Posts in Category Page
- Dynamically update post title in admin page
- Getting an alphabetic post list with two letters onclick on letter
- How to load post content on index page using ajax when post title in sidebar is clicked
- POST from jQuery to PHP
- Working Bootstrap Carousel Conversion to WP – Technical Questions
- “Uncaught SyntaxError: Unexpected token
- Add confirmation popup on “Move to Trash”
- The correct way to call posts with ajax
- How do I use Ajax to show the new posts realtime, on the frontpage
- How to create a load more post entries like Twitter?
- Disable Jquery UI post tabs
- Ajax load more button in Recent posts widget
- Ajax Dynamic Archives not showing correct results
- WP_Query with ajax handler returns the same posts
- Ajax post filters not working
- Ajaxify This Code
- Genesis + Ajax + Jquery | Failling to call action
- How do I locate the exact location where this error is occurring 404 page not found
- Do all wordpress themes a similar class name for content?
- Security to delete post by Admin
- add bootstrap post slider with tabs
- Use Click Image to Play Youtube Video in a WordPress Loop
- Call current post URL in ajax
- datepicker value in mysql
- Adding JS functionality to the Publish button in wp-admin/post.php
- displaying the categories post
- Using the loop to set locations for all posts on a single google map
- Many buttons not functioning in WordPress dashboard (as admin)
- Ajax post doesnt call succes after got the response
- Colorbox not working on native WordPress gallery when gallery is loaded thru AJAX
- How do I use slideToggle inside a wordpress post?
- Printable Page with all Posts from Tag
- problem with creating a wordpress post slider
- Problem with jQuery in post body?
- WP Load post with ajax and apply isotope
- Run Jquery Script after delete post in front end
- Get post id on click of thumbnail
- jquery: getting contents of #content field on post page
- Full width images within post content
- How to Change Order of Posts in Admin?
- How to Display Network Post Count?
- How to disable content pagination?
- How to add/assign or change featured image in post programmatically?
- Exclude ALL posts from sub categories
- Should our pages be posts?
- Allow role to delete posts but block him the wp-admin
- Link post permalinks to subdirectory /post
- How do I add a custom body class to the admin area of a page?
- Remove the Edit button in posts for permalinks on certain user roles? WP 3.3
- How to make the post summary taller?
- Why content_arr[‘extended’] removes paragraph tags?
- Changing Permalinks for Default Post type to reflect navigation
- problems with loading posts in a table-row
- How to have posts have a parent in permalink like site.com/blog/postname
- Second comments section for one post/page
- 404 error on default post type and default taxonomy fronted page
- How i can limit period of post publication?
- Why Query is returning empty array?
- meta_value timestamp older than now
- All Posts Linking to Author Posts directly
- Total number of posts in query (category/tag/author/search results/main page…)
- search blog posts by author first name and or last name
- Make loop inside slider divisible [closed]
- How to add convenient buttons for new custom post statuses
- Change the number of excerpts displayed in search results layout
- Database hacked – random posts are modified
- Getting Whitescreen when publishing a post [closed]
- Display value of custom field at the beginning of a post
- How to display post list in a table layout (multiple queries in single loop)
- add div after image in post [closed]
- How do I link a Post Type to a Template in Masterplan?
- Post is in descendant category not working in home.php
- How to show 3 most recent/viewed posts in a special tiles on home page using wordpress?
- Get content from WordPress posts in Boostrap modal window – Javascript side?
- How can my plugin display a populated new post window
- Where is the “Posts”/”Blog” template?
- How to get posts ordered by using their categories?
- How to assign a post to a post parrent?
- How to get value in radio input in post meta box?
- How to insert custom text after H1 to all my blog posts?
- SQL query: select duplicate posts – but using duplicate meta [duplicate]
- Sync All Post Type Tag
- post and page and custom post type
- how to redirect page after delete post inside a post page?
- Permalink base only for posts
- If I moved the location of my generic “posts” page, do I need to change the slugs for all of the individual posts?
- issue in wordpress auto delete post and redirect to another 1
- Modify WordPress loop after it has been run
- How to get next_posts_link working with a customised page
- Loop doesn’t display posts. It displays a link to the home page instead
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- Super post cleaner, could this be category specific?
- Get current post’s child page?
- Custom Post Type Pagination 404 Error (if paged>=2) [duplicate]
- Show all posts in category
- Creating a new Sortable Column in WordPress Admin
- Display post structure in function
- How to monitor the first publish date?