Articles of jquery

Ajax not updating to database

So I’m having a bit of difficulty getting user input to post to my database. Whenever I try to update the table, I am able to do it successfully on the front end, but on refresh, the data change does not stick. Checking the database further verifies that the data has not been changed… It […]

Return an array from get_terms and store as JavaScript array for search autocomplete

I am trying to use wp_list_pluck to return an array of taxonomy names from get_terms. I’m not sure what I’m doing wrong, but this only echo’s out “Array”: $terms = get_terms(array( ‘taxonomy’ => ‘state’, ‘hide_empty’ => false, )); $term_ids = wp_list_pluck( $terms, ‘name’ ); echo $term_ids; Do you know how I can echo out an […]

Foundation Scripts not loading (custom theme)

I’m trying to create a custom WP theme with foundation but the menu never seem to work. After some time I realized that my scripts loaded (I see them in the header – firebug) but not activating. Weird. This is my functions.php for loading the scripts. Pretty simple: function enqueue_test_scripts() { /* Original Foundation scripts […]

how to add jquery to wordpress

Hello I am trying to enable jquery to my wordpress website. So far i have searched the internet for something that works but nothing helped me. This is my jquery script jQuery(document).ready(function($){ alert(‘test’); }); And this is what i have in my functions php <?php add_action( ‘wp_enqueue_scripts’, ‘add_my_script’ ); function add_my_script() { wp_enqueue_script( ‘jquerydemo’, // […]

WordPress AJAX Upload file not working, custom plugin

I have a form in WordPress that passes file to admin-ajax.php There is no error returned (I only get response from admin-ajax = 0); and its not uploading the file. All work good except when I pass File Object to jQuery and the code seem to break somewhere in jQuery function Here is the code: […]

Unable to remove jquery from header and put in before body ends

For wordpress blog, even after removing wp_enqueue_script(‘jquery’); from theme function jquery is getting loaded, so I have two query: From where jquery is getting loaded How to move default jquery to footer before body tag ends

Ajax call not working with

I’ve created a front end image uploading feature as described in this tutorial The media uploader works I can select the image etc. In x debug the sent parameters are also OK. After selection I wanto to change the imgage url in the database so I’ve made the ajax call in wordpress plugin boilerplate […]

WordPress Customizer Radio Button Images Issue

I’m having a bit of an issue with getting radio buttons as images to save settings/refresh the Customizer when clicked. I followed this guide: Customizer radio image control But to not avail. Here is my code: functions.php: – Creates the Settings & Controls (sections are created elsewhere in a sections.php file) function spiffing_customize_register( $wp_customize ) […]

Default Image not showing up in Customizer for WP_Customize_Cropped_Image_Control

I’m having an issue with WP_Customize_Cropped_Image_Control in the Customizer. The default image that I have set doesn’t show up in the side pane of Customizer where you upload and when I upload a new image, it just outputs a number, presumingly the image ID. The moment I change WP_Customize_Cropped_Image_Control to WP_Customize_Image_Control, everything works. The default […]

Filterable portfolio in WordPress using jQuery isotope

I want to filter portfolio using Isotope. I can show the items but can’t filter. Here is my code. Have a look and share your thoughts what i am missing. <ul id=”cat”> <li> <ol class=”type”> <?php $terms = get_terms(‘portfolio-type’); $count = count($terms); echo ‘<li><a href=”javascript:void(0)” data-filter=”*” class=”active”>All</a></li>’; if ( $count > 0 ){ foreach ( […]