How to get the meta box name and value

It looks like you are trying to build a way to display a group of meta fields for your custom post type. Using get_post_custom you can fetch all the custom post meta for a single post in 1 request. Then using a combination of looping you can build your output as you see fit. A … Read more

Using WP_Query to grab custom meta values, foreach to json object

The best way to go about this is with $wpdb. The query to draw out meta_value by category is: $query = $wpdb->get_results( “SELECT p.`ID`, pm.`meta_value` FROM {$wpdb->postmeta} pm LEFT JOIN {$wpdb->posts} `p` ON `p`.`ID` = pm.`post_id` LEFT JOIN {$wpdb->term_relationships} `tr` ON `p`.`ID` = `tr`.`object_id` LEFT JOIN {$wpdb->term_taxonomy} `tt` ON `tr`.`term_taxonomy_id` = `tt`.`term_taxonomy_id` WHERE `pm`.`meta_key` = … Read more

Meta Box will not display

Try chaining the action hook for first function from: add_action( ‘admin_menu’, ‘true_add_a_metabox’ ); to below: add_action( ‘add_meta_boxes’, ‘true_add_a_metabox’ ); Also make sure that ‘Forum Discussion URL’ under ‘Screen options’ is checked to ensure it displays on edit post screen 🙂

WPAlchemy MediaAccess inserting media link in WP Editor instead of custom field in metabox [closed]

I managed to solve it. The problem was in using a custom post-type with Metabox.php / MediaAccess.php (both from WPAlchemy class) Supposedly you can use custom post-types with WPAlchemy since, when instantiating a WPAlchemy_MetaBox object you can pass some optional parameters to enable that kind of costumization. Like this: $mb = $my_custom_metabox = new WPAlchemy_MetaBox(array … Read more