wordpress snippets last updated   : January 29, 2015
we now have 646 snippets

Login with username or email address

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will let users login using an email address or a username. The second snippet will change the text on the login page from “username” to “username / email” but feel free to change the login text to anything you would like.

read more

Check if post / page has a gallery

wordpress snippet

Adding this snippet to your wordpress theme will let you check to see if a post contains the gallery shortcode. Add this code to the single.php template of your wordpress theme inside the loop.

read more

Change default ‘Enter Title Here’ for custom post types

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will let you change default ‘Enter Title Here’ for custom post types. You will need to update the POST_TYPE name and default text

read more

No excerpt available, display default message

wordpress snippet

Adding this snippet to your wordpress theme will allow you to display a default message when no excerpt has been added.

read more

Facebook open graph snippet to set default image

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will allow you to specify Facebook Open Graph information on your WordPress posts. Allowing you to specify which image should be displayed when sharing your article on Facebook among other things.

read more

Shortcode to display users IP address in posts & pages

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will let you use a shortcode to display the users IP address in your posts or pages.

read more