How to display metabox from specific custom post id

Support General How to display metabox from specific custom post id

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #7525
    damngraphicdamngraphic
    Participant

    Hi I have created metaboxes for my custom post type of 'documents', my prefix is rw:

    $meta_boxes[] = array(
    	// Meta box id, UNIQUE per meta box. Optional since 4.1.5
    	'id' => 'documents_dl',
    	// Meta box title - Will appear at the drag and drop handle bar. Required.
    	'title' => esc_html__( 'Documents', 'rwmb' ),
    	// Post types, accept custom post types as well - DEFAULT is array('post'). Optional.
    	'pages' => array( 'base_documents' ),
    	// 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(
    	// FILE ADVANCED (WP 3.5+)
    	array(
    		'name'             => esc_html__( 'File Upload', 'rwmb' ),
    		'id'               => "{$prefix}_document_file",
    		'type'             => 'file_advanced',
    		'max_file_uploads' => 1,
    		'max_status'       => 'false',
    	),
    	// TEXT
    			array(
    				'name'  => esc_html__( 'test', 'rwmb' ),
    				'id'    => "{$prefix}_testing_text",
    				'type'  => 'text',
    			),
    
    	),
    );

    I'm trying to display the data in my theme footer. I know the ID of the specific post is 124, so I thought I could do this:

    echo rwmb_meta( 'rw_testing_text', 'type=text', 124 );

    but it's not working. What am I doing wrong?

    #7526
    damngraphicdamngraphic
    Participant

    Nevermind. I figured it out. My prefix was actually rw_ so the underscore was duplicated. Doh.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘How to display metabox from specific custom post id’ is closed to new replies.