In a list of recent posts, I am looking to preface each post title with the day of the year (<?php the_time(‘z’) ?>), but from a specific point, i.e. the 71st day of the year. So if the day of the year is 81, it actually displays as Day 10.
I’m having trouble more in the loop, where I can do the math function correctly, but when put into a list with other post entries, the day ends up being the same for all posts, and I think, is taking the day of the year from the current post only, instead of each post individually.
This was the function I was using:
<?php $date = “<?php the_date(z);?>”; ?><?php $start = 71; ?><?php $day = ($date – $start); ?><?php echo $day ?>
- The topic ‘the_date math calculation’ is closed to new replies.