I assume you use the plugin ‘Meta Box’. It should actually work fine if you try it with this line (Example with the Amazon Affiliate), just substitute $bookID
with your ID or get_the_ID():
echo get_post_meta( $bookID, 'rw_amz', true );
Oh, and i just saw that you opened two array
when defining your fields, the correct code should be:
add_action( 'admin_init', 'rw_register_meta_boxes' );
function rw_register_meta_boxes() {
$prefix = 'rw_';
$meta_boxes = array();
// Here is the code to define a meta box
$meta_boxes[] = array(
'title' => 'Amazon Affiliate Link',
'pages' => array( 'books' ),
'fields' => array(
'name' => 'url',
'id' => $prefix . 'amz',
'type' => 'text',
)
);
$meta_boxes[] = array(
'title' => 'Subtitle',
'pages' => array( 'books' ),
'fields' => array(
'name' => 'Subtitle',
'id' => $prefix . 'subt',
'type' => 'text',
)
);
foreach ( $meta_boxes as $meta_box ) {
new RW_Meta_Box( $meta_box );
}
}