Hot answers tagged

2

human_time_difference() will not work here as it returns a string in a human readable form. However, we can use some of the logic used there to construct a workable function You can try the following: (Untested) function get_custom__time_diff() { global $post; // Get the current time $current_time = time(); // Get the post date ...


1

This question has been answered on Stack Overflow before: http://stackoverflow.com/a/14626254/844732 add_action( 'admin_head', 'check_page_template' ); function check_page_template() { global $post; if ( 'page-homepage.php' == get_post_meta( $post->ID, '_wp_page_template', true ) ) { // The current page has the foobar template assigned ...



Only top voted, non community-wiki answers of a minimum length are eligible