wordpress snippets last updated   : August 18, 2014
we now have 638 snippets

Highlight keywords in search results within the_excerpt and the_title

wordpress snippet

I whipped up this little snippet that you can add to the functions.php of your wordpress theme to highlight keywords in search results for the_excerpt and the_title. A few highlight search results snippets floating around including a great one by Michael Martin. However they require you edit template files so this is my take on Michaels Idea.

read more

Include password protected posts in search results

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will allow protected posts to show up in search results even when a user is not logged in.

read more

Show search query in search box and query in results page

wordpress snippet

Adding these snippets to your search template will display the search query on the results page and the search query within the search box on the results page.

read more

Limit search to post titles only

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will limit search to post titles only.

read more

Rewrite the search results slug to /search/term

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will rewrite the search results URL to /search/ that will give you a results URL like http://wpsnipp.com/search/searchterm

read more

Redirect to post when search query returns single result

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will redirect your search to the post automatically when wordpress only returns a single search result.

read more
jqsnipp.com | we just launched jquery snippets website