How to automatically create a custom field when a post is published
Paste the code below into your functions.php file. The only thing you have to do is to edit the cutsom field name on line 6. add_action(‘publish_page’, ‘add_custom_field_automatically’); add_action(‘publish_post’, ‘add_custom_field_automatically’); function add_custom_field_automatically($post_ID) { global $wpdb; if(!wp_is_post_revision($post_ID)) { add_post_meta($post_ID, ‘field-name’, ‘custom value’, true); } } Thanks to wpCanyon for this cool tip! Looking for WordPress hosting?
WordPress tip: Create invisible custom fields
This little trick is extremely simple: All you have to do is give a name starting with an underscore to your custom field when you create it, and it will not be displayed on WordPress dashboard when editing a post, as shown in the example below: add_post_meta($id, ‘_name’, ‘value’); Easy, isn’t it? And of course, very useful Thanks to my friend John Kolbert for the tip! Looking for WordPress hosting? Try WP Web Host
Custom Fields Hacks For WordPress
In our previous articles on WordPress hacks, we discussed the incredible flexibility of WordPress, which is one of the biggest reasons for its popularity among bloggers worldwide. Custom fields in particular, which let users create variables and add custom values to them, are one of the reasons for WordPress’ flexibility
How to: Display your current mood on your posts
Open your single.php file (You can also modify your index.php file) and paste the following code anywhere within the loop: $customField = get_post_custom_values(“mood”); if (isset($customField[0])) { echo “Mood: “.$customField[0]; Save the file. Now when you’ll write a new post, just create a custom field named mood and type your current mood as a value. Wanna make money blogging?

