WordPress.org

Ready to get started?Download WordPress

Forums

Change Monthly Archives to Three Letter Representation (11 posts)

  1. dave601
    Member
    Posted 7 years ago #

    So I am using get_arhives to display my archives and I am wondering if anyone knows of a way to display the archives using the 3 digit abbreviation for the month (January = Jan, February = Feb) instead of the default way (which is displaying the entire name of the month)? Thanks.

    Site can be found at http://www.davedirect.com.

  2. whooami
    Member
    Posted 7 years ago #

    http://codex.wordpress.org/Formatting_Date_and_Time

    wordpress uses the same format that php, itself, uses.. therefore :

    http://us3.php.net/date

    will give you what you need.

  3. whooami
    Member
    Posted 7 years ago #

    checking your site, youve already figured this out.. ah well, thanks for coming back and letting us all know and marking this resolved too :P

  4. dave601
    Member
    Posted 7 years ago #

    Uh...actually I haven't figured this out. I do know all of that about php, but my question is how do I change it for my archives?

  5. whooami
    Member
    Posted 7 years ago #

    aha, I follow, my apologies for not reading closer. wheres the archives page and are you using any plugin to display them?

  6. dave601
    Member
    Posted 7 years ago #

    I am not using any plugin to display the archives. I am not sure what you mean by where's the arhcive page. Do you mean located as in: index\wp-content\themes\mystyle\archives.php? Thanks for the help.

  7. moshu
    Member
    Posted 7 years ago #

    Ah, you mean what is displayed as links in your sidebar?
    For that you'll have to edit WP core files. The get_archives function is in the wp-includes/template-functions-general.php starting at line #277.

  8. dave601
    Member
    Posted 7 years ago #

    Yeah, that is what I am trying to do. I took a look at that file, but...well...my php skills suck. Is this something that is easy to do...like changing a few small things, or is this something that is pretty complex to do?

  9. whooami
    Member
    Posted 7 years ago #

    are you using get_archives or wp_get_archives in your theme file.

    Take a look at that file below the line number moshu suggested.. get_achives is straightforward about making changes to the date:
    // over-ride general date format ? 0 = no: use the date format set in Options, 1 = yes: over-ride
    $archive_date_format_over_ride = 0;

    // options for daily archive (only if you over-ride the general date format)
    $archive_day_date_format = 'Y/m/d';

    // options for weekly archive (only if you over-ride the general date format)
    $archive_week_start_date_format = 'Y/m/d';
    $archive_week_end_date_format = 'Y/m/d';

  10. dave601
    Member
    Posted 7 years ago #

    Ah...I guessed right then. That is what I tried to edit, but didn't get very far. Changing those settings did not change the format the date of my archive links. I am using get_archives, by the way.

  11. zsola2
    Member
    Posted 7 years ago #

    Hello!
    dave601, I'm also fighting with the same problem as you are. Those settings, what whooami suggested are related only for the weekly and/or daly archives, but not for the monthly, what we use.
    So, I also want to convert somehow my archive links in the sidebar to number of the month / year (eg.: 12/06).
    Has anybody an idea to solve it?

    Many thanks,
    Zsola

Topic Closed

This topic has been closed to new replies.

About this Topic