Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How can I build a search filter (something like this) with WordPress?

I have a custom post type name: "Locatii". It is a custom post type with categories.

Ex: Cat 1 , Cat 2 ... and so on.

How can I implement AJAX so that when I click Cat 1 ( checkbox) and Cat 2 I should retrieve the posts that are in that categories, without having a search button.

share|improve this question

2 Answers 2

You'll need to hook into the "onchange" event of javascript. When using jquery, it's as simple as $('<the selector string>').change(function(){});

When ever the values are changed, you'll do an AJAX request to the server with the new parameters & populate the output screen with the new result. For the server-side, you'll check the parameters, do some validations & send the response after reading the data from the database.

This codex article will help http://codex.wordpress.org/AJAX_in_Plugins

share|improve this answer
    
Thanks for your answer, can you give me more details PHP code or a link ... I am not a great connoisseur of Ajax language. –  Batman Nov 24 '12 at 21:18
    
Please go through the link provided in the answer & then add to the question some code that you've tried so far –  Mridul Aggarwal Nov 24 '12 at 21:25
    
Ok, i will do that, i will come with an answer... thanks –  Batman Feb 15 '13 at 15:57

I'd suggest starting with the Query Multiple Taxonomies plugin. As far as I know it doesn't use AJAX, but you could try to extend it to add AJAX support.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.