Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Rodrigo8 on "Call to undefined function add_meta_box()"

$
0
0

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 all articles
Browse latest Browse all 8245

Trending Articles