WordPress – Display array data of a child

This will show the checkboxes that have been ticked (much simpler!!): <?php $categories = get_field(‘categories’); $elements = array(); foreach($categories as $category) { //do something $elements[] = ‘<a href=”https://wordpress.stackexchange.com/tags/design/” . strtolower($category) . ‘” title=”‘ . $category . ‘”>’ . $category .'</a>’; } echo implode(‘,’, $elements); ?>

wordpress custom fields multiple data

You can store an array in a custom field; WordPress serializes it for you on save and unserializes it on get. Name your fields with a pseudo array syntax: <input name=”mycustomfield”> <input name=”mycustomfield[date]”> You’ll get a $_POST array: mycustomfield = array ( ‘audio’ => ‘somevalue’, ‘date’ => ‘somedate’ ) Now you can do whatever you … Read more

Can’t get metabox value (a url) returned using WPAlchemy

Try changing your display_url_info function to <?php add_filter(‘beernews-child-theme_post’, ‘display_url_info’); function display_url_info() { // usually needed global $basic_metabox; $basic = $basic_metabox->the_meta(); if($basic[‘post_link_url’]) { echo $basic[‘post_link_url’]; } else { echo ‘ERROR : “post_link_url” empty’; } } ?> And not to be a jerk, but I would like to point out that WP Alchemy is not a plugin … Read more

get_posts that haven’t been assigned a specific custom field

You can do it with a posts_where filter and a subquery. Note that you have to explicitly set suppress_filters to false, as get_posts normally ignores filters: function wpse28018_posts_where( $where ) { global $wpdb; $where .= ” AND {$wpdb->posts}.ID NOT IN ( SELECT DISTINCT post_id FROM {$wpdb->postmeta} WHERE meta_key = ‘alternate_page’ )”; return $where; } // … Read more