what wrong with this small code? (using the_post)
-
When I run this code it shows the date of 1970-01-01 for $postdate
I want to be able to compare the date the post was created vs other dates. If I use the_date() it echos the date everytime, and I don’t want echos. Any help is appreciated.if (is_single()) { $postdate = date('Y-m-d',strtotime($post->post_date)); if ($postdate < date('Y-m-d', strtotime("-7 days"))) { //return something } }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘what wrong with this small code? (using the_post)’ is closed to new replies.