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

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

Display hidden custom field _values

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will allow you to display hidden custom field values. When a custom field value is prefixed within an underscore _value it will not be displayed, using this snippet will display them temporarily.

read more

Display custom field value of previous and next post

wordpress snippet

Adding this snippet within the loop of your wordpress theme will display the custom field value from the previous and next posts. Just change the CUSTOM_FIELD on line 4 and 5 to the name of the custom field you wish to display.

read more

How to display multiple custom field values

wordpress snippet

Adding this snippet within the loop of your wordpress theme will let you display multiple instances of a custom field value.

read more

Enable shortcode in custom field

wordpress snippet

Adding this snippet to your theme will enable you to place shortcode into a custom field, make sure you change “your_field_name” to the custom field you place the shortcode.

read more

Auto create custom field

wordpress snippet

Adding this PHP code to your functions.php of your wordpress theme will auto create a custom field with a default value. In this example the custom field is sort order,

read more
jqsnipp.com | we just launched jquery snippets website