• Forgive me, I’m kind of a newbie to this. But for the life of me, I can’t “call” the information into the front end of my site once I save the custom data I entered. I’m used to using something like <?php the_title(); ?> to retrieve the title, how would I do it for the metabox below?

    // 1st meta box
    $meta_boxes[] = array(
    // Meta box id, UNIQUE per meta box. Optional since 4.1.5
    ‘id’ => ‘EventTitleHomepage’,

    // Meta box title – Will appear at the drag and drop handle bar. Required.
    ‘title’ => __( ‘Event Title – Homepage’, ‘rwmb’ ),

    // Post types, accept custom post types as well – DEFAULT is array(‘post’). Optional.
    ‘pages’ => array( ‘post’, ‘page’ ),

    // Where the meta box appear: normal (default), advanced, side. Optional.
    ‘context’ => ‘normal’,

    // Order of meta box: high (default), low. Optional.
    ‘priority’ => ‘high’,

    // Auto save: true, false (default). Optional.
    ‘autosave’ => true,

    // List of meta fields
    ‘fields’ => array(

    // WYSIWYG/RICH TEXT EDITOR
    array(
    ‘name’ => __( ‘Event Title – Homepage’, ‘rwmb’ ),
    ‘id’ => “{$prefix}wysiwyg”,
    ‘type’ => ‘wysiwyg’,
    // Set the ‘raw’ parameter to TRUE to prevent data being passed through wpautop() on save
    ‘raw’ => false,
    ‘std’ => __( ‘XXX’, ‘rwmb’ ),

    // Editor settings, see wp_editor() function: look4wp.com/wp_editor
    ‘options’ => array(
    ‘textarea_rows’ => 4,
    ‘teeny’ => true,
    ‘media_buttons’ => false,
    ),
    ),
    )
    );

    https://wordpress.org/plugins/meta-box/

Viewing 1 replies (of 1 total)
  • Hey there,

    Next time, try use the code block when pasting php so we can better read it :).

    So, from what I understand, you just need a way to retrieve metabox data? Check out this function http://codex.wordpress.org/Function_Reference/get_post_meta .

    So for your WYSIWYG metabox, you need to pass in the post_id, metabox_id, and the optional true/false argument.

    <?php echo get_post_meta($post_id, 'meta_wysiwyg', true); ?>
Viewing 1 replies (of 1 total)
  • The topic ‘How do I retrieve the data I entered?’ is closed to new replies.