Custom field losing p tags on display

Add this to your functions.php file: add_filter( ‘meta_content’, ‘wptexturize’ ); add_filter( ‘meta_content’, ‘convert_smilies’ ); add_filter( ‘meta_content’, ‘convert_chars’ ); add_filter( ‘meta_content’, ‘wpautop’ ); add_filter( ‘meta_content’, ‘shortcode_unautop’ ); add_filter( ‘meta_content’, ‘prepend_attachment’ ); Then use this code to pull in the result: <?php $story_content = get_post_meta($post->ID, ‘story’, true); echo apply_filters(‘meta_content’, $story_content); ?>

Save page data to an xml file

The save_post hook gets called each time a post is created or updated. Just hook into that. There you can do something like fputcsv(‘/tmp/’ . $post_id, $post) or output to XML/JSON. == EDIT == add_action( ‘save_post’, ‘wp239s5_post_to_xml’, 10, 2 ); function wp239s5_post_to_xml( $post_id, $post ) { if ( defined( ‘DOING_AUTOSAVE’ ) && DOING_AUTOSAVE ) return … Read more

Extra filed under “About the user” user profile

Add following code in theme’s functions.php file. add_action( ‘show_user_profile’, ‘extra_user_profile_fields’ ); add_action( ‘edit_user_profile’, ‘extra_user_profile_fields’ ); function extra_user_profile_fields( $user ) { ?> <table class=”form-table”> <tr> <th><label for=”address”><?php _e(“Designation”); ?></label></th> <td> <input type=”text” name=”designation” id=”designation” value=”<?php echo esc_attr( get_the_author_meta( ‘designation’, $user->ID ) ); ?>” class=”regular-text” /><br /> </td> </tr> <tr> <th><label for=”city”><?php _e(“Linked In”); ?></label></th> <td> <input … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)