• Fatal error: Call to undefined function add_meta_box() ……. in functions.php on line 161
    When i try to add a meta box in functions.php this happens.I have reuploaded wp-admin/includes/template.php file already, but the error stays still.

    This is the line 161, and part of the code in functions.php that calls the meta box

    add_meta_box(
        'sl-meta-box-sidebar',      // id
        'Sidebar On/Off',           // title
        'sl_meta_box_sidebar',      // callback function
        'page',                     // type of write screen
        'side',                     // context
        'low'                       // priority
    );
    
    function sl_meta_box_sidebar(){
        global $post;
        $custom = get_post_custom($post->ID);
        $sl_meta_box_sidebar = $custom["sl-meta-box-sidebar"][0];
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Call to undefined function add_meta_box()’ is closed to new replies.