Plugins not working
- This topic has 2 replies, 2 voices, and was last updated 10 years ago by
chillifish.
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
April 18, 2015 at 12:39 AM #777
chillifish
ParticipantI must be going mad. I just can't figure out why it won't work. I've copied it from another site that's working perfectly and just changed the names and I'm not getting the metaboxes on the page in question. My code is below:
// Metaboxes (requires meta box plugin) add_filter( 'rwmb_meta_boxes', 'chilli_register_meta_boxes' ); function chilli_register_meta_boxes( $meta_boxes ) { $prefix = 'chilli_'; /* Homepage columns */ $meta_boxes[] = array( 'id' => 'column1', 'title' => 'Column 1', 'pages' => array( 'post', 'page' ), 'context' => 'normal', 'priority' => 'high', 'include' => array( 'template' => array( 'page-home.php' ), ), 'fields' => array( array( 'name' => 'Image', 'desc' => 'Column 1 image', 'id' => $prefix . 'image1', 'type' => 'image_advanced', ), array( 'name' => 'Column 1 text', 'desc' => 'Text for column 1', 'id' => $prefix . 'column1', 'type' => 'wysiwyg', ), ) ); $meta_boxes[] = array( 'id' => 'column2', 'title' => 'Column 2', 'pages' => array( 'post', 'page' ), 'context' => 'normal', 'priority' => 'high', 'include' => array( 'template' => array( 'page-home.php' ), ), 'fields' => array( array( 'name' => 'Image', 'desc' => 'Column 2 image', 'id' => $prefix . 'image2', 'type' => 'image_advanced', ), array( 'name' => 'Column 2 text', 'desc' => 'Text for column 2', 'id' => $prefix . 'column2', 'type' => 'wysiwyg', ), ) ); $meta_boxes[] = array( 'id' => 'column3', 'title' => 'Column 3', 'pages' => array( 'post', 'page' ), 'context' => 'normal', 'priority' => 'high', 'include' => array( 'template' => array( 'page-home.php' ), ), 'fields' => array( array( 'name' => 'Image', 'desc' => 'Column 3 image', 'id' => $prefix . 'image3', 'type' => 'image_advanced', ), array( 'name' => 'Column 3 text', 'desc' => 'Text for column 3', 'id' => $prefix . 'column3', 'type' => 'wysiwyg', ), ) ); }
Any ideas why I'm not getting any metaboxes?
April 18, 2015 at 8:59 AM #779Anh Tran
KeymasterYou missed the
return $meta_boxes
statement at the end of the function. Please try adding it.April 20, 2015 at 3:46 PM #790chillifish
ParticipantAh, of course, that's the bit I didn't copy and paste! Thanks.
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- The topic ‘Plugins not working’ is closed to new replies.