Support » Fixing WordPress » PHP Question: If Date Less Than, Output =

  • Follow up on this request for help:

    I’d like all posts in a certain category be formatted differently if they were written before 2005. What kind of PHP statement would I use to achieve this?

    I’ve read PHP for Goobers and have produced the following:

    <?php if (is_ YEAR IS BEFORE 2005 ()) { ?>

    <?php _e("Filed under:"); ?> <?php the_category(',') ?>

    <?php } elseif (is_YEAR IS AFTER 2005 ()) { ?>

    <?php _e("Filed under:"); ?> <?php the_category(',') ?> on <?php the_time('l, F j, Y') ?>

    <?php } ?>

    I’ve looked up a bunch of different variables, but I can’t figure out what to insert into these statements. Or maybe I’m going about this all wrong.

    All I need is a PHP vocabulary word I can take to the Goober index and read how to set this up… or maybe just someone just tell me how to set it up…

    I just need a little help to get it going. Thanks!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘PHP Question: If Date Less Than, Output =’ is closed to new replies.