Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

bananarama on "Date by season / quarter"

$
0
0

Instead of the normal date / time, I want to display the season in which a post was made. So for instance, march-may = spring (03-05).

I found this topic, but the plugin is no longer accessible.

I know it should be really simple to do, but I just can't hack it. I've tried:

<?php if ( '3' == date('n') ) : ?>
     <p>It's March</p>
<?php else: ?>
     <p>Not February</p>
<?php endif; ?>

Which detects the current month, rather than the post month. But when I try to combine with the post date it doesn't go:

<?php if ($post_date( '3' == date('n') ) ) : ?>
     <p>It's March</p>
<?php else: ?>
     <p>Not February</p>
<?php endif; ?>

Viewing all articles
Browse latest Browse all 8245

Trending Articles