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

Get post ID outside of loop

wordpress snippet

Adding this PHP code snippet to your single.php will return the current post ID.

read more

Private posts for logged in users

wordpress snippet

Using this as your wordpress loop will display posts with the custom field of private only to users that are logged into your website.

read more

Notify members on new posts

wordpress snippet

Adding this PHP code snippet to the functions.php of your wordpress theme will notify users of new posts. Please note that this snippet is best used for low volume sites. Large websites should consider alternative options.

read more

Set maximum post title length

wordpress snippet

Adding this PHP code to the functions.php of your wordpress theme will set a maximum number of words that can be displayed within your post title.

read more

Get the_title outside loop

wordpress snippet

Adding this PHP code to your wordpress theme will display the post title outside the loop.

read more

Get tags outside loop

wordpress snippet

Adding this PHP code to your wordpress theme will display a list of tags outside the loop.

read more