- This topic has 5 replies, 2 voices, and was last updated 3 weeks, 3 days ago by .
-
Topic
-
Hi. How to get rwmb_meta on page ?
I have an setting page.
//mainsettingspage // Register a theme options page add_filter( 'mb_settings_pages', function ( $settings_pages ) { $settings_pages[] = array( 'id' => 'dimainsettings', 'option_name' => 'DiSettings', 'menu_title' => 'DiSettings', 'icon_url' => 'dashicons-edit', 'style' => 'no-boxes', 'columns' => 1, 'tabs' => array( 'general' => 'General Settings', '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' => 'dimainsettings', 'tab' => 'general', 'fields' => array( array( 'name' => 'Logo', 'id' => 'logo', 'type' => 'file_input', ), array( 'name' => 'Meta Description', 'id' => 'meta_description', 'type' => 'textarea', 'placeholder' => 'Meta Description', 'rows' => 4, ), array( 'name' => 'Meta Keywords', 'id' => 'meta_keywords', 'type' => 'textarea', 'placeholder' => 'Meta Description', 'rows' => 4, ), ), ); );
I put the rwmb code to page and need to get values.
<?php $metades = rwmb_meta( $meta_description, ['object_type' => 'setting'], $DiSettings ); $metakey = rwmb_meta( $meta_keywords, ['object_type' => 'setting'], $DiSettings ); ?> <meta name="description" content="<?php echo $metades;?>"> <meta name="keywords" content="<?php echo $metakey;?>">
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.