WordPress Themes, Plugins, Tutorials, Tips And More...

Tag: AJAX

Reviewed – AJAX WP Query Search Filter

You completed your first WordPress website but still wondering what you actually left out with. Answer is simple a website never get completed unless and until it got a powerful search engine to fuel it up. While we talked about many WordPress search plugins in the past, but today we felt that it would be better if we got the things to some specific turns. That’s why with this article, we are going to review the search plugin name AJAX WP Query Search Filter.

Image-1

Ajax WP Query Search Filter is a powerful AJAX search engine that let your user perform more precisely search by filtering the search through post type, taxonomy and Meta field. Moreover, you do get an option to customize the plugin as per your own choice, or else you can have the search plugin your own styling mantra.

Features

Image-2

  • Admin are free to choose whether the search go through post type, taxonomy, meta field or even all of them.
  • Multiple Search Form Supported.
  • Search form support checkbox, radio and dropdown fields.
  • Using Ajax to display result in the same page complete with pagination.
  • Plugin extendable with hooks.
  • Using shortcode to display the search form.

Download, Installation & Configuration

Image-3

  • Upload ajax-wqsf folder to the /wp-content/plugins/ directory
  • Activate the plugin through the ‘Plugins’ menu in WordPress
  • Create your search form in the Advance WQSF.
  • Using [AjaxWPQSF id={form id}] to display the form.

Summary & Review

Image-4

The question lies here only that what I required? Or what’s the option I am looking for? Since the plugin offers the site owner to have different search filters on board so that one can search via post type, taxonomy and Meta field making it a perfect choice for anyone. I say yes for the plugin and suggest site’s owner to give AJAX WP Query Search Filter plugin a try.

Note:

1. Is your product the Next Big Thing? Wanna have the whole of world heard what you are coming up with via our website? We have two options for you to submit your WordPress-related product or service to be reviewed on JustWP.

More Info | Free Submission | Speedy Submission

2. Like the post, then make sure you do follow and like us on both Twitter and Facebook.

How To Add AJAX Functionality To Your Plugin?

Functionality

You, me and even any other developer who have been working or had worked on plugins, always think on how one can add AJAX functionality to the plugin. The idea of using AJAX might even confuse often that what, how and when of plugin will do and perform if AJAX functionality got added. But, thinking on logical way and understanding the base concept, adding AJAX functionality to your plugin is not that much difficult although if you have been using and performing all the required tasks properly. To help you out over the topic, I am dividing this article into three parts – first on understanding what AJAX actually is, second how you can add AJAX functionality to your plugin and third discussing some tips on how to make AJAX addition in proper way as it have to be.

Part 1: Understanding AJAX

AJAX, dubbed as Asynchronous JavaScript and XML is a technology which allows a page to perform actions or updates dynamically without showing or representing any need of reloading it. Using AJAX technology means you are making your web site more responsive and interactive in nature as compared to those of non-AJAX site.

To have AJAX technology on board, the web programmer or developer connects a user interface element like a link, button or some other type on the web page to a JavaScript program. Once the user activates the interface, the JavaScript program sends data request to a web server URL from where the request made.

Next, a web server program processes the request and sends back the requested data, which is typically in XML format. On receiving the data in the browser, the JavaScript program will receive an “asynchronous” notification, which once processed can be displayed in an appropriate manner. AJAX plays an important role in the world of today’s most visual web browsers. The result of only such responsiveness in AJAX nature, the technology has been adopted by all sorts of web sites, including WordPress.

Part 2: Adding AJAX Functionality To The Plugin

#1 On The Administration Side

As AJAX already comes as built-in core WordPress screens, adding more glimpses to it is not much a difficult task. You can do this by adding some JavaScript which will trigger the AJAX request in the following manner:

Once done, all you need to do is to set up a PHP function which will handle the request.

Source: WordPress Codex

Although this completes your task here, but make sure you do add the required extra miles to it i.e. error checking and verifying that the request comes from the right place or not.

#2 Different JavaScript File

The same snippet work here as that of the previous one we used, but you need to have JavaScript on a separate external file which will call js/my_query.js while the handler function will remain same as that of last example (above).

#3 On The Viewer-Facing Side

From WordPress 2.8 and further version, you will find a hook similar to wp_ajax_(action) and wp_ajax_nopriv_(action) executes for users that are not logged in. If you want to execute on the front-end for both visitors and logged-in users, just add up the following snippet.

Part 3: Tips On How To Make AJAX Addition In A Right Way

#1 Using wp_localize_script()

While you have seen using the function wp_localize_script() for localization purpose, you can use the same for declaring JavaScript variables with namespace to use with your script.

Source: garyc40 via GitHub

#2 Using admin-ajax.php for handling AJAX requests

All the AJAX requests directed towards the wp-admin/admin-ajax.php. And, for which a parameter called action is required to send it to admin-ajax. The parameter will fire one of the hooks when admin-ajax processes the request.

Source: garyc40 via GitHub

#3 Use The built-in jQuery Form Plugin

You usually use AJAX to avoid reloading the page when submitting forms while you might be missing on learning the fact that WordPress also offers a jQuery plugin to handle AJAX form submission.

Source: garyc40 via GitHub

Photo Credit: Flickr/Rexness

Note: If you like the post, make sure you do share your views via the comments below and also like and follow JustWP.org on Facebook and Twitter.

Powered by WordPress & Theme by Anders Norén