Register Meta Boxes

Hi,
This content will show you how can register my framework to create Meta Boxs(called Options/Settings) for each Page, Post or any Custom Post Type which already registered on your website.

When you already have zip file plugins on your computer, have 2 solutions to integrate.

A. SOLUTION 1
– Step 1: Install & Active SmartFramework as other plugins on wordpress.org(View how to do it here)
– Step 2: Create your MetaBox file config(should download meta-boxs-config.php HERE) then copy it to your theme. Or follow to create manual.
– Step 3: Go to file functions.php file(in your theme), add path point to your file config.
– Step 4: Open/Edit file meta-boxs-config.php, update value post type you want below, can add new/change/remove to array:
add-remove-post-typeDone.

Example(i’m using “twentyfifteen” theme for demo):
E1: After install & active smart-framework plugins on your website.
E2: Download file demo meta-boxs-config.php HERE
then extract & copy to “\twentyfifteen\inc\” directory. Look like:
path-copy-metabox-file-to
E3: Copy code below to functions.php:

– E4: Change value Post Type to Page(mean: apply for only Page)
post-type-page

E5: After that, click Add New Page here:

add-new-page

then scroll down to bottom, you will see new area Settings display look like:
preview-setting-metabox

That is success for integrate Meta Boxs options to Page.

B. SOLUTION 2
Step 1: Extract smart-framework.zip to your local computer, look like:
sm-structureStep 2: Copy “smart-framework” directory above to any directory in your theme. In my demo, i used “twentyfifteen” and i copied to “inc” directory, view here:
sm-directoryStep 3:
Open file functions.php in your theme, add line:
require_once get_template_directory() . ‘/YOUR_PATH/smart-framework/smart-framework.php’;

In my demo, i copied to “inc” so i will add:

Step 4: 
Do Example in SOLUTION 1 above and do follow it without E1 step. Now you can use Settings(MetaBox) for your page. Check reference DEFINE FIELDS of SmartFramework.

Thanks