My website has been up for 10 years and as such has gone through various layout changes. Whenever I have made a new layout, I have added all news stories that were made under that layout into a new Wordpress category so I could target said stories and keep the same layout applied to them. This is the code I've used:
<?php rewind_posts(); ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <?php if ( in_category('2563') ): ?> (layout coding) <?php elseif ( in_category('919') ): ?> (layout coding) <?php elseif ( in_category('3') ): ?> (layout coding) <?php else: ?> (layout coding) <?php endif; ?> <?php endwhile; ?>
I'm once again changing my layout, but I don't want to keep making new categories since it just makes things look messy. So I was wondering if there was a way to instead of basing the news story layouts on category, to base them on their creation date. So I would like to be able to do something like... "if X story was published between 7/15/03 at 1:03 PM and 9/19/07 at 11:34 AM, use the following layout." Like the code above, but with time/date ranges. Does anyone know if this is possible? Thank you so much!