wordpress snippets last updated   : April 22, 2014
we now have 631 snippets
category search

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

Add search form to specific wp_nav_menu

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will add the search form to your wordpress wp_nav_menu. Don’t forget to update the MENU-NAME to specify the menu you wish to display within, just in case you have multiple menus.

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
jqsnipp.com | we just launched jquery snippets website