• First of all the plugin is great. Very stable and functional. Thanks!

    I’m trying to limit the live search to the currently viewed category. In other words I want to include &cat=ID in the query.

    I was hoping the following would do the trick but it didn’t:
    searchResultsList.append('<input type="hidden" name="cat" value="ID" />');

Viewing 2 replies - 1 through 2 (of 2 total)
  • You’ve got the right idea.

    At the bottom of daves-wordpress-live-search-ajax.php, you’ll have to add “cat” = $_GET[‘cat’] to the parameters passed to WP_Query.

    You’re on the right track with the rest. Put that line of yours in daves-wordpress-live-search.js.php, put something like:

    searchResultsList.append('<input type="hidden" name="cat" value="<?php echo $_GET['cat']; ?>" />');

    It’s a PHP script that spits out JavaScript, so you can do cool things like that. ??

    Good luck! If that doesn’t give you the solution, it should get you darn close. Let me know how it works out!

    – Dave

    I did as you said above but doesn’t work Dave

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Dave’s WordPress Live Search] Search current category-only?’ is closed to new replies.