I am trying to create a meta box as a plugin in my WordPress test website.
I am using an installed custom theme from a tutorial I am following from Udemy called, 'WordPress E-Commerce Development w/ WooCommerce & Storefront'. I have copied the parent theme and have created the child theme as per the tutorial directions.
Instead of implementing the 'Advanced Custom Fields' plugin as directed in the tutorial, I decided to go and create my own custom plugin for creating a meta box.
I have a added a folder(simple-homepage-field) in the wp-content/plugins, and the plugin file as simple-homepage-fields.php
I have activated the plugin and have this code:
function add_homepage_meta_box() { add_meta_box( 'homepage_meta_box', // $id 'Banner Fields', // $title 'homepage_meta_box_display', // $callback 'page', // $screen 'normal', // $context 'high' // $priority ); } add_action('add_meta_boxes', 'add_homepage_meta_box');
I was hoping this would work, but it has thrown this error and I dont know why or how to fix it:
Warning: call_user_func() expects parameter 1 to be a valid callback, function 'homepage_meta_box_display' not found or invalid function name in C:\wamp64\www\carolinaspa\wp-admin\includes\template.php on line 1343
Why would this interfere/clash with this function??
Any help will be appreciated. Thanks