get fields to page again
Support › MB Settings Page › get fields to page againResolved
- This topic has 2 replies, 2 voices, and was last updated 4 years, 2 months ago by
Martin Rybos.
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
February 4, 2021 at 7:26 PM #24322
Martin Rybos
ParticipantI'm going according to the tutorial
//mainsettingspage // Register a theme options page // Register a theme options page add_filter( 'mb_settings_pages', function ( $settings_pages ) { $settings_pages[] = array( 'id' => 'pencil', 'option_name' => 'pencil', 'menu_title' => 'Pencil', 'icon_url' => 'dashicons-edit', 'style' => 'no-boxes', 'columns' => 1, 'tabs' => array( 'general' => 'General Settings', 'design' => 'Design Customization', 'faq' => 'FAQ & Help', ), ); return $settings_pages; } ); //mainsettingspage add_filter( 'rwmb_meta_boxes', 'meta_box_group_demo_register' ); function meta_box_group_demo_register( $meta_boxes ) { //mainsettingspage $meta_boxes[] = array( 'id' => 'general', 'title' => 'General', 'settings_pages' => 'pencil', 'tab' => 'general', 'fields' => array( array( 'name' => 'Logo', 'id' => 'logo', 'type' => 'file_input', ), array( 'name' => 'Layout', 'id' => 'layout', 'type' => 'image_select', 'options' => array( 'sidebar-left' => 'https://i.imgur.com/Y2sxQ2R.png', 'sidebar-right' => 'https://i.imgur.com/h7ONxhz.png', 'no-sidebar' => 'https://i.imgur.com/m7oQKvk.png', ), ), ), ); $meta_boxes[] = array( 'id' => 'colors', 'title' => 'Colors', 'settings_pages' => 'pencil', 'tab' => 'design', 'fields' => array( array( 'name' => 'Heading Color', 'id' => 'heading-color', 'type' => 'color', ), array( 'name' => 'Text Color', 'id' => 'text-color', 'type' => 'color', ), ), ); $meta_boxes[] = array( 'id' => 'info', 'title' => 'Theme Info', 'settings_pages' => 'pencil', 'tab' => 'faq', 'fields' => array( array( 'type' => 'custom_html', 'std' => 'Having questions? Check out our documentation', ), ), ); return $meta_boxes; }
on frontend
<?php $value = rwmb_meta( $logo, ['object_type' => 'setting'], $pencil );//or general i tried ?> <body> <?php echo $value; ?>
I don't understand. There is no echo there.
url to pageFebruary 5, 2021 at 11:15 AM #24334Long Nguyen
ModeratorHi Martin,
Did you assign the variable to a value?
$logo = 'logo'; $pencil = 'pencil';
Or add it directly in the helper function:
$value = rwmb_meta( 'logo', ['object_type' => 'setting'], 'pencil' );
February 5, 2021 at 7:28 PM #24338Martin Rybos
ParticipantEasy. Thank you
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.