• Resolved Rena

    (@peacearena)


    I am helping a friend merge several blogs done in Movable Type and PostNuke into a WordPress blog. Once all the old posts are imported, I want to have a message about these imported posts show on all archive pages within that date range (like 9/1/2003 to 5/24/2005), either in the sidebar, post meta data, wherever — I’m not picky.

    I know I need to use the conditional tags for dates, but don’t exactly know how to work out the multiple conditionals.

    Any assistance would be appreciated.

Viewing 1 replies (of 1 total)
  • Within the [post loop in single post pages you could accomplish this rather easily:

    <?php
    $testdate = get_the_time('Y-m-d');
    if( ($testdate > '2003-09-01') && ($testdate < '2005-05-24') ) :
    ?>
    Imported posts message goes here.
    <?php endif; ?>

    Now, if there are no posts previous to 9/1/2003:

    if( ($testdate < '2005-05-24') ) :

    will do.

Viewing 1 replies (of 1 total)
  • The topic ‘How to post a sidebar message conditioned by date range’ is closed to new replies.