ID ); $selected = isset( $values['header_choice_select'] ) ? esc_attr( $values['header_choice_select'][0] ) : ''; $check = isset( $values['footer_widget_check'] ) ? esc_attr( $values['footer_widget_check'][0] ) : ''; wp_nonce_field( 'page_opt_meta_box_nonce', 'meta_box_nonce' ); ?>

Select Header Element:

* To select header for blog go to Appearance / Theme options / Blog Options
* Note: Dot menu template doesn't support custom header

/>

array( // on allow a tags 'href' => array() // and those anchords can only have href attribute ) ); if( isset( $_POST['header_choice_select'] ) ) update_post_meta( $post_id, 'header_choice_select', esc_attr( $_POST['header_choice_select'] ) ); $chk = ( isset( $_POST['footer_widget_check'] ) && $_POST['footer_widget_check'] ) ? 'on' : 'off'; update_post_meta( $post_id, 'footer_widget_check', $chk ); } /* * --------------------------------------------------------------------- * MNKY Custom header image * --------------------------------------------------------------------- */ add_action( 'add_meta_boxes', 'custom_header_id' ); function custom_header_id() { $post_types = get_post_types(); foreach ( $post_types as $post_type ) { if ($post_type == 'ad_post_type') {$post_type = 'page';} add_meta_box( 'custom_header_img_url', 'Custom Header Image URL', 'custom_header_img_add', $post_type, 'normal', 'high' ); } } function custom_header_img_add( $post ) { $values = get_post_custom( $post->ID ); $chi_url = isset( $values['custom_header_id'] ) ? esc_attr( $values['custom_header_id'][0] ) : ''; wp_nonce_field( 'custom_header_img_add_nonce', 'meta_box_nonce_chi' ); ?> Header Image will only work if "Custom Header Element" chosen.
Enter image full URL (include http://)

array( // on allow a tags 'href' => array() // and those anchords can only have href attribute ) ); if( isset( $_POST['custom_header_id'] ) ) update_post_meta( $post_id, 'custom_header_id', esc_attr( $_POST['custom_header_id'] ) ); } /* * --------------------------------------------------------------------- * MNKY Custom header HTML * --------------------------------------------------------------------- */ function custom_header_b($post) { global $metaBox; if (function_exists('wp_nonce_field')) { wp_nonce_field('awd_nonce_action','awd_nonce_field'); } foreach ($metaBox['fields'] as $field) { echo '
'; //get attachment id if it exists. $meta = get_post_meta($post->ID, $field['id'], true); switch ($field['type']) { case 'media': ?>
URL: '.$attachUrl.'

'; } ?>

'; } //end foreach }//end function custom_header_b function saveMetaData($post_id, $post) { //make sure we're saving at the right time. //DOING_AJAX is set when saving a quick edit on the page that displays all posts/pages //Not checking for this will cause our meta data to be overwritten with blank data. if ( empty($_POST) || !wp_verify_nonce(isset($_POST['awd_nonce_field']) && $_POST['awd_nonce_field'],'awd_nonce_action') || $post->post_type == 'revision' || defined('DOING_AJAX' )) { return; } global $metaBox; global $wpdb; foreach ($metaBox['fields'] as $field) { $value = $_POST[$field['id']]; if ($field['type'] == 'media' && !is_numeric($value) ) { //Convert URL to Attachment ID. $value = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE guid = '$value' AND post_type='attachment' LIMIT 1"); } update_post_meta($post_id, $field['id'], $value); }//end foreach }//end function saveMetaData /** * Add JavaScript to get URL from media uploader. */ function embedUploaderCode() { ?> 'custom_header_html_add', 'title' => 'Custom Header HTML, insert anything you want.', 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( 'name' => 'Textarea', 'desc' => 'Custom Header HTML will only work if "Custom Header Element" choosen. Supports Flash objects and shortcodes!', 'id' => 'custom_header_html', 'type' => 'textarea', 'std' => '' ) ) ); add_action('admin_menu', 'mytheme_add_box'); // Add meta box function mytheme_add_box() { $post_types = get_post_types(); foreach ( $post_types as $post_type ) { global $meta_box; add_meta_box($meta_box['id'], $meta_box['title'], 'mytheme_show_box', $post_type, $meta_box['context'], $meta_box['priority']); } } // Callback function to show fields in meta box function mytheme_show_box() { global $meta_box, $post; if (function_exists('wp_nonce_field')) { wp_nonce_field('mytheme_nonce_action','mytheme_nonce_field'); } foreach ($meta_box['fields'] as $field) { // get current post meta data $meta = get_post_meta($post->ID, $field['id'], true); switch ($field['type']) { case 'textarea': echo '', $field['desc'],'

'; break; } } } add_action('save_post', 'mytheme_save_data'); // Save data from meta box function mytheme_save_data($post_id) { global $meta_box; // verify nonce if ( empty($_POST) || !wp_verify_nonce(isset($_POST['mytheme_nonce_field']) && $_POST['mytheme_nonce_field'],'mytheme_nonce_action') || defined('DOING_AJAX' )) { return; } // check autosave if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { return $post_id; } // check permissions if ('page' == $_POST['post_type']) { if (!current_user_can('edit_page', $post_id)) { return $post_id; } } elseif (!current_user_can('edit_post', $post_id)) { return $post_id; } foreach ($meta_box['fields'] as $field) { $old = get_post_meta($post_id, $field['id'], true); $new = $_POST[$field['id']]; if ($new && $new != $old) { update_post_meta($post_id, $field['id'], $new); } elseif ('' == $new && $old) { delete_post_meta($post_id, $field['id'], $old); } } } /*********************************************** PORTFOLIO META BOXES **************************************************/ add_action( 'add_meta_boxes', 'pf_meta_box_add' ); function pf_meta_box_add() { add_meta_box( 'portfolio_meta_box', 'Item Options', 'pf_meta_box', 'portfolio', 'normal', 'high' ); } function pf_meta_box( $post ) { $pf_values = get_post_custom( $post->ID ); $pf_text = isset( $pf_values['pf_meta_box_text'] ) ? esc_attr( $pf_values['pf_meta_box_text'][0] ) : 'Client:'; $pf_text2 = isset( $pf_values['pf_meta_box_text2'] ) ? esc_attr( $pf_values['pf_meta_box_text2'][0] ) : ''; $pf_text3 = isset( $pf_values['pf_meta_box_text3'] ) ? esc_attr( $pf_values['pf_meta_box_text3'][0] ) : 'Model:'; $pf_text4 = isset( $pf_values['pf_meta_box_text4'] ) ? esc_attr( $pf_values['pf_meta_box_text4'][0] ) : ''; $pf_text5 = isset( $pf_values['pf_meta_box_text5'] ) ? esc_attr( $pf_values['pf_meta_box_text5'][0] ) : 'URL:'; $pf_text6 = isset( $pf_values['pf_meta_box_text6'] ) ? esc_attr( $pf_values['pf_meta_box_text6'][0] ) : ''; $pf_text7 = isset( $pf_values['pf_meta_box_text7'] ) ? esc_attr( $pf_values['pf_meta_box_text7'][0] ) : ''; $pf_selected = isset( $pf_values['pf_meta_box_select'] ) ? esc_attr( $pf_values['pf_meta_box_select'][0] ) : ''; wp_nonce_field( 'pf_meta_box_nonce', 'meta_box_nonce2' ); ?>

Choose cover style for portfolio item thumbnail.


Leave second field blank to disable corresponding string. Default detail titles are changeable.


This content will be displayed next to thumbnail in portfolio one column view. array( // on allow a tags 'href' => array() // and those anchords can only have href attribute ) ); // Probably a good idea to make sure your data is set if( isset( $_POST['pf_meta_box_text'] ) ) update_post_meta( $post_id, 'pf_meta_box_text', wp_kses( $_POST['pf_meta_box_text'], $pf_allowed ) ); if( isset( $_POST['pf_meta_box_text2'] ) ) update_post_meta( $post_id, 'pf_meta_box_text2', wp_kses( $_POST['pf_meta_box_text2'], $pf_allowed ) ); if( isset( $_POST['pf_meta_box_text3'] ) ) update_post_meta( $post_id, 'pf_meta_box_text3', wp_kses( $_POST['pf_meta_box_text3'], $pf_allowed ) ); if( isset( $_POST['pf_meta_box_text4'] ) ) update_post_meta( $post_id, 'pf_meta_box_text4', wp_kses( $_POST['pf_meta_box_text4'], $pf_allowed ) ); if( isset( $_POST['pf_meta_box_text5'] ) ) update_post_meta( $post_id, 'pf_meta_box_text5', wp_kses( $_POST['pf_meta_box_text5'], $pf_allowed ) ); if( isset( $_POST['pf_meta_box_text6'] ) ) update_post_meta( $post_id, 'pf_meta_box_text6', wp_kses( $_POST['pf_meta_box_text6'], $pf_allowed ) ); if( isset( $_POST['pf_meta_box_text7'] ) ) update_post_meta( $post_id, 'pf_meta_box_text7', wp_kses( $_POST['pf_meta_box_text7'], $pf_allowed ) ); if( isset( $_POST['pf_meta_box_select'] ) ) update_post_meta( $post_id, 'pf_meta_box_select', esc_attr( $_POST['pf_meta_box_select'] ) ); } /*********************************************** NON SORTABLE PORTFOLIO CATEGORY CHOOSE *********************************/ add_action( 'add_meta_boxes', 'add_portfolio_cat' ); function add_portfolio_cat() { add_meta_box( 'portfolio_cat', 'Portfolio categories to show in paged portfolio template', 'portfolio_cat_id', 'page', 'normal', 'default' ); } function portfolio_cat_id( $post ) { $cat_values = get_post_custom( $post->ID ); $cat_id = isset( $cat_values['portfolio_cat_id_value'] ) ? esc_attr( $cat_values['portfolio_cat_id_value'][0] ) : ''; wp_nonce_field( 'portfolio_cat_id_nonce', 'meta_box_nonce3' ); ?> Enter SLUG names of categories (comma separated) you want to show in paged portfolio template or leave blank to show all.

array( // on allow a tags 'href' => array() // and those anchords can only have href attribute ) ); if( isset( $_POST['portfolio_cat_id_value'] ) ) update_post_meta( $post_id, 'portfolio_cat_id_value', wp_kses( $_POST['portfolio_cat_id_value'], $allowed ) ); } ?>