Date comparison : which date format?

The date format for entering the date is largely irrelevant. strtotime will convert a lot of different formats to UNIX time. Just make sure your input format makes sense to your users and make sure that your feed strtottime a format that correctly converts to UNIX time. If you are storing data in the *_postmeta … Read more

Make datestamp for status updates show time

Just go to Settings > General, scroll down to the date formatting section, select custom, and type this: F jS, g:i a which yields a date like: June 1st, 7:29 pm The official WordPress docs give the letters to use for time formatting.

Display yesterday’s last post’s Custom field from Unique terms of one Taxonomies

I hope I understood everything correct: display a specific custom field from a custom post-type post assigned to a specific term in a custom taxonomy for todays and yesterdays latest entry I can’t solve this task improving your SQL-statement, but you can try the following function using standard WordPress stuff: function show_latest48h_post_cf_in_term( $cpt, $tax, $term_slug, … Read more

check if a draft has been moved there from publish to draft

As far as I can see, you won’t get any indication a post was previously published, as wordpress remembers only the old versus new transitions. I recommend you add some meta data, that is use add_action(‘publish_post’, ‘your_function’) (or similar) to do update_post_meta($post->ID, ‘post_published’, ‘on’). That way, every post gets an indicator when it’s published – … Read more

WordPress archives by custom field and date

This will get the posts filtered by custom field and its value based on categories. $args = array( ‘post_type’=>’post’, ‘category__in’=> array(6, 7, 31), //category id ‘meta_key’=>’keys’, // customfield name ‘meta_value’=>5, // customfield value ‘posts_per_page’=>-1, ‘number_posts’=>-1 ); $s = get_posts($args); foreach($s as $e ) { echo $e->ID.'<br/>’; echo $e->post_title.'<br/>’; }