wordpress snippets last updated   : October 6, 2014
we now have 641 snippets

Browser detection

wordpress snippet

Adding this PHP code to your functions.php will add a class on the body tag within your HTML document with the specific browser name.

read more

Exclude cat from search

wordpress snippet

Adding this PHP code just above the loop in your wordpress search.php template. Make sure to place a - minus before the category ID you wish to exclude.

read more

Auto create custom field

wordpress snippet

Adding this PHP code to your functions.php of your wordpress theme will auto create a custom field with a default value. In this example the custom field is sort order,

read more

Adding breadcrumbs

wordpress snippet

Adding the first block of code to your functions.php will setup everything for your breadcrumbs. Add the second section of code in the location you wish to have your breadcrumbs displayed.

read more

Disable wordpress search

wordpress snippet

Adding this code to your functions.php within your wordpress theme will disable search.

read more

Insert favicon with function

wordpress snippet

Adding this PHP code to your functions.php of your wordpress theme will insert the HTML for your favicon.

read more