Show array of meta_value in Edit Post Coloum

The error was here: (Thank you @Rarst) if ($column_name == ‘custom_checkbox_group_sesso’) { $sesso_occupanti = get_post_meta($post_ID, “custom_checkbox_group_sesso”, true); //check that we have a custom field if ($sesso_occupanti != “”) { // Separate our comma separated list into an array $sesso_occupanti = explode(“,”, $sesso_occupanti); //loop through our new array foreach ($sesso_occupanti as $sesso) { echo $sesso ; … Read more

pull all posts’ meta key values from current category only

Apologies, but my PHP isn’t wonderful… but I believe for someone who has some at least average php skill, this will make sense. I cut and pasted this line from a query I am doing against a custom taxonomy myself where I only wanted it to display each term only once. $terms = array_map(“unserialize”, array_unique(array_map(“serialize”, … Read more

Ordering by ‘Title’ OR ‘Custom Field’

i assume its exclusive to either sort by title $_GET[‘sort_title’] OR sort by custom field ( but not necessarily) and you that you pass $_GET[‘sort_price’]. if neither are present, “title” is default. with that in mind, check both values if( isset($_GET[‘sort_title’]) ) { $sort_by = $_GET[‘sort_title’]; //orderby can accept multiple values } elseif ( isset($_GET[‘sort_price’]) … Read more

Meta Box Plugin Cloned Fields – Multiple Foreach values

amit helped you out, but while we’re at it you really shouldn’t be echoing everything like that. Should probably try this instead: <?php foreach ( $videoID as $value ) { ?> <div class=”video-pops”> <a class=”thumb video-pop-lb” data-video-pid=”<?php echo $videoID; ?>”></a> <?php } ?> And so on. You may even be better off using the alternate … Read more

Display custom field value as a mailto: link

well you did all the hard stuff, so you can try this: while ( $loop->have_posts() ) : $loop->the_post(); $mail = get_post_meta($post->ID, ‘mail’, true); if ($mail) { echo ‘<a href=”https://wordpress.stackexchange.com/questions/60953/mailto:”.$mail.'”>email me at ‘.$mail.'</a>’; } /* … */

Adding a Custom Field to be used by Posts 2 Posts

Not sure if you really need to use the custom admin boxes, unless you need to customize labels, etc… <?php function my_connection_types() { // Make sure the Posts 2 Posts plugin is active. if ( !function_exists( ‘p2p_register_connection_type’ ) ) return; p2p_register_connection_type( array( ‘name’ => ‘cpt1_to_cpt2’, ‘from’ => ‘cpt1’, ‘to’ => ‘cpt2’, ‘admin_box’ => ‘from’, ‘fields’ … Read more