How do I get my suggest to only suggest one taxonomy?

After join term_id exist two times. You should specify which term_id you are querying by prefixing full table name (or alias). Also there is a other error term_taxonomy.term_id = terms.term_id missing table prefix. So the updated query will look like $query = ‘SELECT term_taxonomy_id, ‘ . $wpdb->prefix . ‘terms.term_id, taxonomy, name FROM ‘ . $wpdb->term_taxonomy … Read more

Change shortcode value by jquery in WP Editor

Shortcodes are backend stuff, so you can’t just change values of shortcodes itself in editor with jQuery, the thing you can do is to call both shortcodes, hide one of them, and on click show him and hide other one. It all depends what do you want to do, but one of the option is … Read more

Redirect wp_dropdown_pages() to an AJax request?

The following is the solution I came up with: <div id=”selection1″> <div id=”dropdown1″> <form id=”choice1″ action=”<?php bloginfo(‘url’); ?>” method=”get”> <?php $select = wp_dropdown_pages( array( ‘post_type’ => ‘page’, ‘show_option_none’ => ‘Select Car’, ‘echo’ => 0 ) ); echo $select; ?> </form> </div> <div id=”firstchoice”></div> </div> <script> $(‘#choice1’).change(function(){ //if the select value gets changed var png = … Read more

No Object Properties sending form through AJAX

You can try to use new FormData() instead of new FormData($(‘form#change-avatar’)[0]). Also, after processData:false you should add contentType: false since jQuery will set it incorrectly otherwise, and for url, instead of ajaxurl you should useajaxobject.ajaxurl, since with wp_localize_script, the second parameter is the javascript object name

jQuery plugin not loading

It might be the case that you are using you JS validation before enqueuing this script. You code may be like.. <html> $(“#myForm”).validate(); or JS file that uses validate() jquery.validate.js here </html> Above code is just for demonstrating. So you are using validate() function before it has been enqueued so it is throwing validate() is … Read more

Moving jQuery to footer from header

The proper way to wp_enqueue_script is : wp_enqueue_script(‘jquery’, get_template_directory_uri() . ‘/js/jquery.js’, array(), ‘1.11.3’, true); The last parameter is $in_footer set it true which will insert the script into the footer. Note: You don’t need to include jquery bcz by default it is added in WordPress.

General Settings: display custom plugin field after Site Address field

Figured it out by using the following jQuery function. The #protocol_relative is the field I am inserting and #home-description is the field I am inserting it after: add_action( ‘admin_footer’, ‘insert_field’ ); function insert_field() { # Insert the settings field after the ‘Site Address (URL)’ ?> <script type=”text/javascript”> jQuery( ‘#protocol_relative’ ).closest( ‘tr’ ).insertAfter( jQuery( ‘#home-description’ ).closest( … Read more

jQuery – Toggle megamenu submenu items by click

Try this -> jQuery(document).ready(function($) { $(‘#menu-main-menu a’).click(function( event ){ var visibleSubmenu = $(‘#menu-main-menu ul.sub-menu:visible’); var submenu = $(this).next(‘ul.sub-menu’); if( submenu.length >= 1 ) { event.preventDefault(); visibleSubmenu.slideUp(); submenu.slideToggle(); } }); });

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)