Just Need A quick way to add and if – else statement to this
-
What I want this to do is to show update only if the post is updated, done with the code, but I can seem to get around with the if-else statement
Original Code
function givi_posted_on() { $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
Function to update the code
$u_time = get_the_time('U'); $u_modified_time = get_the_modified_time('U'); if ($u_modified_time >= $u_time + 86400) { echo '<p class = "last-updated-up">Last updated on '; the_modified_time('F jS, Y'); echo "</p> "; } }
How do I go around with the if-else statement, thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Just Need A quick way to add and if – else statement to this’ is closed to new replies.