jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is included with WordPress, and available to both themes and plugin developers.
7
votes
2answers
3k views
$ not defined using jQuery in Wordpress
I know that jQuery is loaded, because I can switch out the $ for 'jQuery' and everything behaves as expected, but this will be a messy script if I can't fix this
This script:
...
7
votes
1answer
3k views
How to manage ajax calls and JSON in wordpress
I have a custom post type that i want to access through jQuery - preferably using JSON.
So first things first. creating a function that returns/echos json is easy enough, but how would I access it ...
3
votes
2answers
1k views
Adding jquery and thickbox to wordpress theme
I would like to add thickbox for the template which I develop to wordpres. At this time I'm trying with a clean template that have only header.php footer.php index.php and functions.php
I've included ...
8
votes
2answers
3k views
How to Link External jQuery/Javascript files with WordPress
So I'm using Starkers to base my next WP theme on and I've run into a small issue, I was including my own version of jQuery in the header.php file but when inspecting my site using Firebug I noticed ...
4
votes
1answer
1k views
How can I fetch loop of post titles via AJAX?
I have a list of the most recent post titles in sidebar.php. Here is an example of how that code looks:
<?php $args = array('posts_per_page' => 20); ?>
<?php $sidebar = new ...
1
vote
2answers
598 views
How to trap “Publish” button to check for meta box validation?
I'm trying to do some form validation on my custom meta box, and I remember somewhere reading about some javascript function to disable/enable the Publish button - except I can't find it.
How do I ...
8
votes
2answers
6k views
How to save the state of a drag and drop jQuery UI Sortables front end layout editor?
I am building a front end post layout editor using jQuery UI Sortable.
The posts are laid out in 300px by 250px boxes over a background image. The posts are created and edited using the WordPress ...
10
votes
2answers
770 views
pass object/JSON to wp_localize_script
I've got a working piece of javascript that contains an object literal.
But I need to localize it, and I'm ytrying to figure out how to rewrite it so that I can get wp_localize_script() to accet it, ...
0
votes
1answer
392 views
Any good lightbox-like option that works in WP 3.2.1?
I'm having problems finding a "plugin" that will help me display some of my images in a nice way such as prettyPhoto, Lightbox etc.
As I'm already using the jQuery library, I'd prefer a plugin that ...
7
votes
3answers
3k views
Validating Custom Meta Box Values & Required Fields
Something which I have never seen covered is the best way to validate that specific form fields are filled out correctly for custom post type meta boxes.
I am looking to get expert opinions on how ...
5
votes
3answers
2k views
wordpress json custom taxonomy problem
I created 1 custom post type with 2 custom taxonomy. Installed http://wordpress.org/extend/plugins/json-api/ and tried to reach result with:
...
3
votes
1answer
3k views
How to make ajax call in wordpress in right way?
I am trying to using jquery ui tabs with ajax calls to run a function. Here is the code i am using:
function ajax_load_user_feed(){
if(isset($_GET['type'])) $type = $_GET['type'];
...
2
votes
4answers
2k views
Asynchronous Javascript Loaders
I'd like to take advantage of loading my scripts while the page is loading. ie. Yepnope, head.js etc...
But I also want to be able to enqueue the script so other plugins don't try adding their own. ...
0
votes
1answer
742 views
ajax jquery update custom field meta value front end
There is probably a much easier way to do this. After much trial and error trying to get a postid from a url, I've opted to add the id to the permalink. However I have no idea how the custom value ...
5
votes
2answers
3k views
How to dequeue a script?
Wordpress has wp_enqueue_script() but not a wp_dequeue_script() function, so what would be the best way to dequeue a script? I'm using LAB.js to load all of my scripts rather than enqueueing them ...
0
votes
1answer
2k views
How to save Uploaded image in custom option panel?
I'm trying to add a custom option panel to a new template following a tutorial found on NetTuts. I saved all the code for the option panel inside a file called optionpanel.php (LoL) and everything is ...
-1
votes
2answers
540 views
Integrating WordPress Content into a jQuery Slider
I have a pretty basic 'featured-list - image slider' implemented above my content in my custom WordPress theme. How do I integrate WordPress content into the slider so that the slide content is pulled ...
9
votes
1answer
252 views
Using jQuery to delete data stored in wp_options
I wonder if anyone could advise me further on my problem. Part of my plugin stores log files for debugging purposes. I have successfully displayed them in a (div#log) in my admin page using jquery ...
1
vote
2answers
599 views
Why Won't my jQuery Play Nice with Wordpress?
Code in question here: http://pastebin.com/PN29WKNq
It worked on the HTML page I tested it on. Its supposed to add "display: none" to the content divs and then add "display: block" when the ...
0
votes
1answer
507 views
Trying to get fittext to work in Wordpress
I have the following code in my template page and I have registered jquery and fittext in my theme's functions.php. They are currently showing up in the footer as I set them to. I can set them up in ...
0
votes
1answer
117 views
Using jQuery .after inside loop
I have a bit of javascript that will dynamically add a static post to a loop. The script uses the jQuery 'after' method and on a static page it works beautifully but when inside the loop I don't get ...
-2
votes
1answer
64 views
WordPress and jQuery [closed]
I am fairly new to using jQuery in WordPress and I am trying to write jQuery scripts in a separate file.
What is the difference between the following two syntaxes of setting up the external file:
...
10
votes
4answers
4k views
Using Wordpress 3.5 Media Uploader in meta box?
Is this possible to do?
I love how the new uploader works. I'm guessing it has to do with a jQuery call like the other way did.
EDIT
This is the code I am currently using
...
6
votes
1answer
1k views
Display Media Uploader in Own Plugin on Wordpress 3.5
I have little problem with Media Uploader in new WordPress 3.5. I created own plugin which is upload the picture. I'm using this code JS:
<script type="text/javascript">
var file_frame;
...
5
votes
5answers
3k views
Including jQuery and jQuery files the correct way
I´m having some trouble with this. I´m not sure how to do it the correct way, and I read so many different techniques and ways to do it that I dont know what to make of it.
Some questions and ...
4
votes
5answers
3k views
What is a good jQuery content slider plugin? [closed]
I'm looking for a plugin that will let me easily place a jQuery based (because I want to avoid the hassle of multiple javascript libraries) slider on my site in various places. I'd like it to be able ...
3
votes
1answer
2k views
Add custom shortcode button to Editor
Before the new version of Wordpress 3.0 came out I was using this jQuery code below to add custom buttons for my own shortcodes to the editor toolbar in the admin panel, it worked great. However with ...
2
votes
1answer
846 views
Custom function to rearrange attachments when creating posts – Almost there
I'm having some trouble with a custom thing I'm doing.
I've implented a custom image uploader into a metabox in a custom post type.
Now I'm trying to work out a way that will let me reorder the ...
1
vote
3answers
538 views
WordPress Featured Post Slider
Alright, I have almost finished up a clients project in WordPress, but I have hit a wall. I am not really great with jQuery (and I have yet to find a plugin to achieve what they are looking for). The ...
1
vote
2answers
1k views
How do I “unhook” / de-register jQuery so that it's not called as part of wp_footer();?
I need to "unhook" jQuery from my wp_footer() ... it's being called automatically and I'm looking for something I can add to functions.php which prevents it from being called a second time in the ...
1
vote
3answers
815 views
Best approach for loading a sidebar Only if the screen max-width is >900px?
I have been playing around with media queries quite a bit lately and I love the concept. It is so easy to display images or change div floats depending upon what the users screen max-width is.
I'm ...
6
votes
3answers
3k views
What is the simplest ajax upload plugin or script to be used with wordpress?
I'm trying to use image upload in my theme's options page and haven't found yet a simple ajax upload script with many tutorials or a good documentation, I just want a simple straightforward script so ...
4
votes
3answers
272 views
Handling jQuery Component Collision
In plugin development, what is the best practice to prevent jQuery component collision on the front end?
For instance, let's say I include the jQuery Apprise dialog in a plugin that loads this on the ...
4
votes
2answers
973 views
Making $ globally accessible with jQuery.noConflict()
The Codex promotes this method of using $ inside a plugin/theme JavaScript file:
jQuery(document).ready(function($) {
// $() will work as an alias for jQuery() inside of this function
});
But ...
3
votes
4answers
740 views
Wordpress 3.5 Media Manager - add a button
In my plugin, I would like to add two buttons to Media Manager (to the left of "Insert Into Post" in "media-toolbar-primary" section), and connect a jQuery action to it.
First one - The "Select All" ...
2
votes
1answer
762 views
Querystring data gets truncated
When I check "view source > frame info" on the window produced by the jQuery code below, it cuts off the querystring at the &type=image. I'm url encoding the ampersands properly, right?
Address: ...
1
vote
0answers
234 views
jQuery Plugin to use Wordpress functions in AJAX request
I'm using Chained Selects jQuery Plugin to create multiple chained selection fields. I'm using the remote version of the plugin to build the related options by means of AJAX request from a separate ...
1
vote
2answers
1k views
wp_mail script with jquery post
need to send an email from a page when a form is submitted.
Thought i'd use jquery post but not really sure where to start. Would i use wp_mail? And if so how could it be called ?
Sorry if that ...
0
votes
1answer
382 views
Jquery checkbox -show posts with checked tags
Using jquery, How do I show a checkbox with the list of tags in the sidebar, and only show posts of the checked tag?
I cant seem to find this anywhere
4
votes
1answer
758 views
Make jQuery library load before plugin files
I am using a few jQuery plugins such as validate.js, but they all load BEFORE the Jquery library which is loaded automatically by WordPress and my theme.
I need the plugins to load after - so is ...
3
votes
2answers
1k views
Add a jQuery function to admin pages
I need to add a bit of document ready jQuery to post/page editors in admin. I'm hacking an old plugin that adds a text box to the editor page and handles inserting that text in a template file, but ...
3
votes
2answers
265 views
AJAX function returning -1
I recently developed a small plugin for my site, that uses AJAX, and now I am trying to implement the same AJAX techniques for the same site's templates, but I keep getting -1 as the result, here is ...
2
votes
2answers
175 views
How Do I Use jQuery UI In My Plugin
It's a sad day in the world when I Google something and it returns nothing. I am trying to use the default datepicker (or ANY datepicker at this point) and am unable to because of my lack of ...
2
votes
4answers
120 views
Debug whats going on inside a function called from AJAX
I have a link on my post edit page (admin side) that calls up AJAX and jQuery to run a function inside my functions.php page. The link is wired up and calling the jQuery but I can't seem to debug ...
2
votes
2answers
676 views
Twitter Bootstrap Use Collapse in Custom Post Type
I am using Bootstrap with Wordpress and I want to implement the collapse functionality in the content for single pages of a specific custom post type.
I know I could create a shortcode, however, ...
2
votes
3answers
1k views
How to handle multiple instance of “send_to_editor” js function
Here is what I am doing:
I Added wordpress media upload with iframe popup when a button or link clicked. And with click of insert into post the image url placed on a textbox.
send_to_editor() ...
1
vote
1answer
192 views
jQuery Ajax() doesn't work when the page is accessed as a WordPress template page
In one file (test_ajax.php) I have a which on change loads another page (registration_form_race_type.php) with a short message via jQuery Ajax(). It works fine when "test_ajax.php" is accessed via its ...
1
vote
2answers
480 views
Using Ajax call in jQuery doesn't work in widget
So I'm in the midst of creating a new conversion widget and I'm having some trouble getting the Ajax call to work in my widget. (works perfectly outside of WordPress).
The problem at the moment is ...
1
vote
3answers
416 views
Bind to WPSetAsThumbnail
is there a way to bind some extra script to the WPSetAsThumbnail function? the function automatically inserts the image into the post's metabox, but what if i wanted to do something else with it? ...
1
vote
1answer
1k views
jQuery Hoverintent plugin in TwentyEleven Menu [closed]
The default menu in the TwentyEleven theme is quite nice, pure CSS, but unfortunately, way too responsive and quick. It would be so nice to have it respond the same exact way with which the admin bar ...