wordpress snippets last updated   : August 18, 2014
we now have 638 snippets
category theme

Create page on theme activation

wordpress snippet

If you are creating a new theme either for sale of for a client you may want to have it create a custom page or pages when the theme is activated. Adding this snippet to the functions.php of your theme will do just that.

read more

Remove title attribute from wp_tag_cloud

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will remove the title=”” attribute from the anchor tags when using wp_tag_cloud.

read more

Attach images with simple thumbnail selection metabox

wordpress snippet

A little snippet I wrote recently to easily attach images to posts with a simple thumbnail selection metabox. Add the first snippet to the functions.php of your wordress theme. Place the second snippet within the loop of your wordpress theme to display the images in your posts or pages.

read more

Conditionally display content on last post

wordpress snippet

Adding this snippet within the loop of your wordpress theme will let you display something only if it is on the last posts.

read more

Remove p tag from around images in the_content

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will remove the HTML p tag from around images in the_content.

read more

Display author avatar within posts or pages

wordpress snippet

Adding this snippet to your wordpress theme within the loop will display the current authors avatar.

read more