WordPress.org

Ready to get started?Download WordPress

Forums

archive.php | not displaying correct Month and Year (5 posts)

  1. 32flavorsdance
    Member
    Posted 6 years ago #

    Hi.

    My archives index is not displaying the correct Month and Year title.

    The linking is working, so clicking in the sidebar on January 2008 for exp. pulls in the correct content for January 2008 but the title will have the wrong Month and Year.

    All titles will display as 'Archives | October,2007' for some reason (instead of the correct month and year)

    I believe that my archive.php is set up correctly, here is a section of code:

    <h3 class="archive">Archives |
    <?php /* If this is a category archive */ if (is_category()) { ?>
    Posts tagged as '<?php single_cat_title(''); ?>

    <?php /* If this is a yearly archive */ } elseif (is_day()) { ?>
    Posts written in <?php the_time('l, F jS, Y'); ?>

    <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    <?php the_time('F,Y'); ?>

    <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    Posts written in <?php the_time('Y'); ?>

    <?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
    <p>You have searched the
    /"><?php echo bloginfo('name'); ?>
    weblog archives for '<?php echo wp_specialchars($s); ?>'.
    If you are unable to find anything in these search results, you can try one of these links.</p>
    <?php } ?>
    </h3>

    Thoughts of where the error could be? Any help is appreciated. Check it out here:

    http://www.32flavorsdance.com

    Thx!

    -Meghan

  2. 32flavorsdance
    Member
    Posted 6 years ago #

    Problem still exists... but temporarily made a change so it wouldn't show- any thoughts still appreciated.

    -Meghan

  3. thatcoolbroad
    Member
    Posted 6 years ago #

    I'm having the same issue...the archives bring up the chosen months posts...but at the top is says that they are the archived posts for the CURRENT month. I'm using the Cutline 3 column split template and I don't think I've messed with any code in the archive.php or archives.php.

    Anybody have any ideas?

    Thanks!
    tcb

  4. gregbarr23
    Member
    Posted 5 years ago #

    Can't help, unfortunately, just another "me too." Only mine isn't displaying the current month for all (both at this point) monthly archives, but the FIRST month, July 8.

    Doesn't seem like it's a widespread problem or one with a well-documented fix, unfortunately. : (

  5. gregbarr23
    Member
    Posted 5 years ago #

    Anybody made progress or have any ideas on this problem?
    The relevant code in archive.php, which I've commented out at this point, is this:

    <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    <!--<h2 class="pagetitle">Archive for <?php the_time('F, Y'); ?></h2>

Topic Closed

This topic has been closed to new replies.

About this Topic