If you want to use Jsearch on your site, download it here:
Once downloaded, follow these instructions:
- Unzip the plugin to your plugins/jsearch folder like this:
- Copy the jsearch_template.php file to your current theme's directory so it's available to your theme to be selected as a page template.
- Create a new page and select the Jsearch template from the Template drop-down list. This newly created page will be your search landing page.
- Click on the "Jsearch Config" link in the tools or plugins area on the left menu in the WordPress dashboard. Once there, select the page you just created in the drop-down list (so the plugin knows which page is using the template) and click "SAVE" at the bottom of the settings page.
- Mess with the other settings if you wish, but you're basically done (if you do change something, remember to click "SAVE" at the bottom to save the changes).
- (Optional but recommended) Replace the normal search widget in your sidebar with the Jsearch equivalent. This customized search box will feed directly to the Jsearch page and contains an "Advanced Search" link that will go directly to the search page without having to enter any terms first (it's with all the other widgets on the widgets page).
This is probably not the most elegant and awesome way possible to make this all work, but it's all I could figure out.
By default, the behavior of Jsearch is determined by what I thought was best. If you want to change that, you can do so in the Jsearch options screen. Besides changing the defaults, you can hide certain controls from your users if you don't want them to make changes or think that it would only confuse them (or take up space that's not needed).
There are 2 default listing styles (Jsearch default and WordPress default) and 3 custom templates that can be configured as needed.
This allows you to style and customize your results just like you would for any WordPress template. You can also have multiple views in the same WordPress installation depending on the need. For example, for normal results on my City of Heroes fan page, I like the results to be the Jsearch Default, but then I used the Custom1 template and customized it to show a thumbnailed list when browsing the image gallery.
Note that the custom template I used to make the thumbnails is included as Custom1 as a sample, but will not work on your page since I use another custom plugin that you don't have in it. It is only included so you can see how the code can be done (if you want to see it working, go here: Jordan's Town Gallery).
Full URL Customization
Every aspect of the jsearch control (and a few others) can be set via the URL. For example, the thumbnail search I just mentioned is triggered by loading the search page with the following variables in the URL string:
- &cat_all=106 – 106 is the id of the Gallery category. This restricts all results to gallery photos only
- &ppp=24 – Sets the number of posts per page to 24
- &results_type=custom1 – Sets the results template to Custom1
- &order=asc – Sets the results to show in ascending date order (WordPress default is descending order). I do this for my gallery so that when you bookmark a page, new additions don't change the photos that are on page 295 for example.
Using this method, I can have the standard defaults as set in my administration panel, but create tailored views on the fly using nothing more than a link with some variables.
Jsearch Widgets and Inputs
There are a variety of controls that can be used to launch the Jsearch page:
Google-like Jsearch Box
This specifically was excluded from the widgets of Jsearch because google-like search boxes generally don't appear in sidebars or have standard sidebar headers and footers. So using this requires that you find a place in your template you'd like the box to appear and entering this line:
<?php jsearch_gbox(150); ?>
The 150 is the width I wanted the box to be. You can also set the height by adding it after the width like this jsearch_gbox(150,20). If you leave both blank, it defaults to 100 pixels wide by 17 tall.
This box uses the same code to parse terms as the term input on the jsearch page itself. You can use +, – or quotes just like you can there. Just like a Google box, you hit the ENTER key when done. The page will then open the jsearch page and begin the search.
Multiple Category Checkbox Selector
The very first ever jsearch function makes a return! Use the following code anywhere:
And you'll get a list of categories just like the one in WordPress except there will be checkboxes next to them that will let you select multiple categories.Other types of input are planned for the future, but that's all I could manage for now
The Newest Version
|About Jsearch Version 2 - Leaner interface, custom-built query that handles all the hard searches that WP doesn't.|
|Jsearch Tutorial - For site visitors and users of Jsearch to learn (very quickly) how to USE the Jsearch interface.|
|Jsearch Setup - Download and learn how to install and customize Jsearch here. For site administrators who want to use Jsearch on their site.|
Older Versions (for historical purposes)
|Version 1 - Jquery enabled and functional, but awkward to use in some ways.|