How to pull data from a table using wpdb?

First, you want to use the global $wpdb variable. global $wbdp; Then set up your query. Make it a separate variable so you can output it and check for syntax errors. $my_query = $wpdb->prepare( /* SQL query here */ ); Then execute the query. $results = $wpdb->get_results( $my_query );

Multiple level category drop-down three levels is not working

Already was resolve my problem and the cause is because the component was created dinamically, the solution is use .on(“change”, instead .change(function(). I share the code of Ján Bočínec with the modification to use three dropdownlist or more. //Parent child con ajax function parent_child_cat_select() { ?> <script type=”text/javascript”> /* <![CDATA[ */ jQuery(document).ready(function() { //segundo drop … Read more

$ not defined using jQuery in WordPress

You can wrap your javascript inside a self-invoking function, then pass jQuery as an argument to it, using $ as the local variable name. For example: (function($) { $(document).ready(function(){ $(“ul.vimeo_desc_feed li a”).click(function(){ alert($(this).attr(‘href’)); return false; }) }); }(jQuery)); should work as intended. If I remember correctly the WP-supplied version of jQuery (the one you get … Read more

Why does my media selection script write to ONLY the first input field?

this problem is because of the first “if”, the good text field in only set the first time to change that, you can add a “data” arguement in HTML and change the JavaScript code like that (look the modification in meta_image_frame.on(‘select’…) (function($) { ‘use strict’; $(function() { var meta_image_frame; function saveImage(e, uiElement) { e.preventDefault(); if … Read more

wordpress ajax upload media not working

This looks like the access to admin-ajax.php is forbidden (error 403). For some reason, many security plugins are preventing access to admin-ajax.php, even with this file being essential for WordPress to work correctly. If you use some security plugin, check out if it is maybe blocking admin-ajax.php. Check if admin-ajax.php is blocked in .htaccess file … Read more