You shouldn't have to be an expert to be safe on a computer.

Home

Guides

Seminars

Tips and Tricks

Log in
Keywords
Categories
Tags
Options
1. Enter Keyword(s):
2. Add to Search:




Filter:
Filter:
Search:



Show:



Posts Per Page:
English-ness:


Results Listing Type:

Jsearch – WordPress Multiple Category, Tag, and Term Search

Monday, July 5th, 2010 (103 comments)

About the only big disappointment with WordPress that I've ever had is that you can't do any kind of advanced searching and none of the available plugins seem to get the job done either.

After I put together my own little hack for searching in multiple categories, I had the idea to make something more advanced that handled tags and terms as well. It was a bit weak, but I learned a lot.

For the last year and longer, I've had requests and suggestions for features such as making it widget compliant and capable of searching custom fields.

I'm happy to announce that after over 100 hours of development, I have finally completed the first ever Jsearch plugin. Each prior version was just a code hack, but this one handles pretty much everything I've ever been asked to include.

Features

Easy Search

Allows your visitors to do advanced query building using a slick and simple interface. For example, they could:

  • Search for items in the beach or mountain categories with the resort keyword as long as it didn't contain the complete dump tag.
  • Search for any posts, pages, or both that contain the word monster in the title.
  • Find anything tagged with Michael Jackson that was also in the Photo Gallery category that did not include the keyword Presley

Clearly, you can get very, very specific about what you're looking for.

Searching titles containing FACEBOOK, but not FOUNDER
Searching titles containing FACEBOOK, but not FOUNDER

Strong Administrative Control

In the Jsearch administration screen, you can set default options for most aspects of the search as well as whether your visitors can change that option or not. Nearly every control can be hidden preventing users from changing your preferred way of searching.

The Jsearch control panel in the WordPress dashboard
The Jsearch control panel in the WordPress dashboard

Customizable Results

There are 2 default listing styles (Jsearch default and WordPress default) and 3 custom templates that can be configured as needed.

Jsearch default
Jsearch default
Wordpress default
WordPress default

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.

Using the custom templates to do a thumbnail search (example only)
Using the custom templates to do a thumbnail search (example only)

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 a 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:

http://www.jordans-town.com/jsearch/?paged=295&cat_all=106&ppp=24 &control_vis=min&results_type=custom1&order=asc

  • &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
  • &control_vis=min – Minimizes the Jsearch control on first page load (this is a new feature that makes the control stay out of the way until it's needed).
  • &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.

Installation

If you want to see how it works first, just try it out. Otherwise, download it and try it here.

Once downloaded, follow these instructions:

  1. Unzip the plugin to your plugins/jsearch folder like this:
    Just like every other plugin really...
    Just like every other plugin really...
  2. 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.
  3. Create a new page using the Jsearch template.
  4. Click on the "Jsearch Config" link in the plugins area on the left menu in the WordPress dashboard. On that page, 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.
  5. 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).
  6. (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.

NOTE! I know there's an error where even after setting and saving the Jsearch target page, you'll still see a notice saying you haven't, but that will go away on it's own. I don't know what causes it but when I do, I'll put a fix in for it.

Tags: , ,

Nuke Anything – Stop Wasting Ink By Printing Stuff You Don’t Want

Thursday, October 29th, 2009 (No comments yet)
Zap the distracting stuff and save ink too
Zap the distracting stuff and save ink too

Using Nuke Anything, you can adjust the page you're currently viewing by removing ads, pictures, or almost anything else that you don't want to see. Not only can you use this for better viewing of really cluttered pages, but you can also make the print view far more clean so you don't waste ink by printing stuff you don't want/need.

Click on the picture below to see a sample of a page before and after using Nuke Anything:


A page before and after the cleaning process. Just point, right-click, and remove
A page before and after the cleaning process. Just point, right-click, and remove
Tags: , ,

Targeted Advertising Cookie Opt-Out (TACO)

Thursday, October 29th, 2009 (No comments yet)
Blocks tracking cookies from the major advertisers online
Blocks tracking cookies from the major advertisers online

If you were aware of the many companies that track you around the web and use the profiles they build on you to send you targeted advertising, you probably didn't know that you can opt out of this tracking one at a time with many of those companies.

How convenient.

While I suppose it's very nice that these companies will stop taking your private browsing habits from you without your knowledge or permission if you go through their hoops to stop it, there's a much easier way. A privacy-minded geek helpfully compiled a list of all the opt-out cookies that the ad networks look for to flag you as someone who shouldn't be tracked.

Further, he modified a free Google app that restores certain cookies after wiping your cookie files to preserve the opt-out cookies. So install TACO and you will better avoid being tagged and tracked like an animal online.

Tags: , ,

Adblock Plus – Firefox Ad Blocker

Thursday, October 29th, 2009 (No comments yet)
Prevent ads from annoying you and taking your bandwidth
Prevent ads from annoying you and taking your bandwidth

Having an effective ad blocker is a great thing. Not only do you not see those extremely annoying and sometimes inappropriate ads on pages, since your browser never downloads the graphics for them, the page will load faster, you don't waste ink when you print the page, and the web bugs and cookies planted by ad services to track you are defeated as well!


Tags: , ,

Long URL Please – Firefox Plugin for Link Safety

Thursday, October 29th, 2009 (No comments yet)

If you didn't know, because of Twitter and other social sites with space restrictions on posts, there are new "url shortening" services out there like "tinyurl" that instead of showing you something like this:

http://lifehacker.com/5234539/long-url-please-replaces-shortened-links-with-the-real-thing

Shows you something like this instead http://tinyurl.com/cblos7

The advantage is that you save valuable space on your tweets or blog posts, but the disadvantage is that you have no idea where you're really going. Considering that sometimes the only thing that keeps you from getting hacked is NOT going to bad websites, these shortening services present an enormous risk to your computer security.

However, if you go to the Lifehacker article linked above, you'll find an article that describes a plugin for Firefox that will replace the shortened URL with the full one (providing several different options for how they are displayed.

A side by side comparison of a typical string of tweets (short urls included) and what they look like after being expanded
A side by side comparison of a typical string of tweets (short urls included) and what they look like after being expanded

To get the plugin, follow the link from the Lifehacker article, or just click here to go directly to the plugin's page.

Alternatives

If you aren't using Firefox or can't install the plugin for some reason, most shortening services have a preview function that allows you to see the URL you're going to before actually going there. To activate the preview feature, do the following:

Tinyurl: Prefix with "preview"
From – http://tinyurl.com/cblos7
To – http://preview.tinyurl.com/cblos7

Is.gd: Suffix with a dash
From – http://is.gd/3KvWm
To – http://is.gd/3KvWm-

Bit.ly: Suffix with + (not an official preview funciton, but does show title and URL anyway)
From – http://bit.ly/info/aq44T
To – http://bit.ly/info/aq44T+

Cli.gs: Not currently possible
Snipurl: Not currently possible

Tags: , ,

WordPress Hacks

Monday, July 5th, 2010

Of course I don't mean "hack" in the bad sense. This page is about the plugins, modifications, and tricks I've found to improve the operation of WordPress. In some cases, it's stuff that they didn't think about. In some cases, they made decisions about program behavior that I don't agree with. In either case, I've found that when I need a fix, but can't find it online already, there's plenty of other people who need it to. So here you go; enjoy!

WordPress Hacks

Advanced search capability with the Geek Professor's very own Jsearch plugin.
Get File Path to WordPress Theme.
Just because you aren't using pretty permalinks doesn't mean you don't want to be able to set a post slug anyway.
Tags: ,
Support the Geek

If you hate ads as much as I do, please consider supporting us by donating or browsing our recommended products


Recommended Products and Services
Quick Tips:

Jsearch - Wordpress Multiple Category, Tag, and Term Search

Jsearch, the most complete search plugin available for Wordpress. Handles multiple categories, tags, and keywords all at the same time. Widget enabled!

[Click for full description]

Get File Path to Wordpress Theme

Here's a tip to get the file path to your current Wordpress theme.

[Click for full description]

Hack Wordpress to Make Postnames Always Editable

When using ordinary permalinks, you're blocked from editing the postname when doing posts and pages. This is senseless and must be stopped!

[Click for full description]