wordpress snippets last updated   : September 29, 2014
we now have 639 snippets

Allow more HTML tags in the editor

wordpress snippet

By default the wordpress editor does not allow some tags and will strip them out. Adding this snippet to the functions.php of your wordpress theme will enable you to use HTML tags like iframe, name, class etc…

read more

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

Get current category ID

wordpress snippet

Adding this PHP code to your functions.php of your wordpress theme will let you return the current category ID number.

read more

Check parent ID

wordpress snippet

This snippet will allow you to check if a parent is a particular ID.

read more

User ID from username

wordpress snippet

Adding this PHP code to your wordpress theme will return the user ID from the username.

read more

First category ID of post

wordpress snippet

Adding this to your functions.php of your wordpress theme will allow you to get the first category ID of the current post when calling getParentCatID() from your theme.

read more