Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I only have this code, which is in functions.php. I can see the field in admin page, but the data is not saving.

add_action('add_meta_boxes', 'home_page_template_meta_box');
function home_page_template_meta_box(){
    add_meta_box(
        'home_page_template_options',
        __('Home Page Template Options'),
        'home_page_template_options',
        'page'
    );
}

function home_page_template_options(){
    //My custom fields

    $right_side_box_1 = esc_html( get_post_meta( $post->ID, 'Right Side Box 1', true ) );
    ?>
    <table>
        <tr>
            <td style="width: 100%">Right Side Box 1</td>
            <td><input type="text" size="80" name="right_side_box_1" value="<?php echo $right_side_box_1; ?>"/></td>
        </tr>
    </table>
    <?php
}
share|improve this question
1  
    
+1 that code does not have any function to save datas. You just have to follow codex example and use update_post_meta() if $_POST['right_side_box_1'] is set. –  JMau Jun 8 '13 at 18:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.