Hello -
To explain the title of this thread, for most of my posts I only want the month / year to display, but for one category I need the day / month year.
I spent some time looking at this yesterday, hoping I could test for the category and display the date accordingly. I know very little re. PHP but I found the "get_the_category" tag and tried this, which doesn't work:
<div class="blogpost" id="post-<?php the_ID(); ?>">
<div class="postdate">
get_the_category(post_category, $output) ?>
<?php if(post_category('20')) : ?>
<span class="postday"><?php the_time('l'); ?></span>
<span class="postmo"><?php the_time('M d'); ?></span>
<span class="postmo"><?php the_time('Y'); ?></span>
<?php else : ?>
<span class="postmo"><?php the_time('M'); ?></span>
<span class="postmo"><?php the_time('Y'); ?></span>
<?php endif; ?>
</div>
What is the right way to do this?