WordPress.org

Ready to get started?Download WordPress

Forums

PHP Question: If Date Less Than, Output = (2 posts)

  1. RosieMBanks
    Member
    Posted 9 years ago #

    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!

  2. Lorelle
    Member
    Posted 9 years ago #

    This is a list of the conditional tags used in WordPress:

    http://codex.wordpress.org/Conditional_Tags

    What you are asking is very specialized and unusual, and it make take a while for a volunteer experienced enough with this to come in and find your question.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags