I am using Custom Metaboxes and Fields for Wordpress
I am using the
datetime_timestamp custom meta with a page. I am trying to echo the title of the page I am using the custom meta datetime in. But it is not working. I have the code incorrect. And I may possibly be far off!
I have the code in the header, and I want to display 1 with the closest datetime.
global $post; $text = get_post_meta( $post->ID, '_cmb_test_datetime_timestamp', true ); $time = current_time( 'Y-m-d' ); if ($text <= $time) echo $post->post_title;
It is displaying the title of the most recent title when viewing a page of post. Or if I am viewing a single post page it displays that post title.
I think I might need to make a custom loop possibly. I am a bit lost.