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

Show absolutely all custom fields for each post

wordpress snippet

This snippet will display absolutely all custom fields for each post. Even custom fields you may not even be aware exist like _edit_lock and others. We have Justin Sternberg to thank for writing this snippet that was submitted a while ago as part of his tutorial on wordpress custom fields. Since this snippet is not available other than in the tutorial I figure it should be posted separately.

read more

Prepend ‘Sponsored post:’ to post title using post_meta

wordpress snippet

Simple little snippet that will use a custom field sponsored set to true will prepend “‘Sponsored post:” to the_title. The second snippet will prepend the value of sponsored to the_title.

read more

Attach PDF files to post with custom metabox file selection

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will create a new metabox within your post editing screen with a select menu listing all PDF files. Adding the second snippet in your wordpress template in the location you wish to display the files URL.

read more

Add custom field automatically when post or page is publish

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will add a custom field to a post or page when published. Don’t forget to update the FIELD_NAME and the CUSTOM VALUE.

read more

Remove support for specific post type features

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will remove support for the specific features bellow from specified post types. Change the word ‘post’ to anything you like including a custom post type name or the default post, page.

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
jqsnipp.com | we just launched jquery snippets website