How to show title in get_post_meta, not ID
-
Hi, in my code below, I am echoing $session which outputs the ID of the conference_stream1, I would like to show the name of this, not the ID?!
add_filter('manage_session_posts_columns', 'session_date_head'); function session_date_head($columns) { unset( $columns['author'], $columns['date'], $columns['comments'] ); $new_columns = array( 'session_date' => __('Session Date / Time', 'session_date'), 'conference_stream1' => __('Conference Stream', 'conference_stream1'), ); return array_merge($columns, $new_columns); //return $defaults; } // Display session details add_action('manage_session_posts_custom_column', 'session_event', 10, 2); function session_event($column_name, $post_ID) { global $wpdb; switch ($column_name) { case 'conference_stream1': $sessions = (get_post_meta($post_ID, "conference_stream1", true)); echo $sessions.'<br/>'; foreach ($sessions as $session) { $seminar_session_stream = get_field('seminar_session_stream'); $conference_steams_obj = get_field_object('conference_stream1'); //var_dump($conference_steams_obj['choices']); var_dump($session); $ex_seminar_stream = $conference_steams_obj['choices'][$session]; echo $conference_steams_obj.'<br/>'; } break; case 'session_date': $date = (get_post_meta($post_ID, "session_date", true)); echo '<strong>Date: </strong>'. date("d-m-Y", strtotime($date)).'<br/> '; echo '<strong>From: </strong>'. get_post_meta($post_ID, "start_time", true).' '; echo '<strong>To: </strong>'. get_post_meta($post_ID, "end_time", true); break; default: break; } }
- The topic ‘How to show title in get_post_meta, not ID’ is closed to new replies.