Ready to get started?Download WordPress


[resolved] Display monthly archives in numbers (01.08.2013) (2 posts)

  1. lola rennt
    Posted 1 year ago #

    Hello WordPress community,

    Is there a way to get the wp_get_archives tag to display the monthly archives in numericals? Much like you can format the_time and make it use numbers instead of the full written out date, I would like to have numbers for my monthly archives:

    instead of

    january 2009
    february 2009
    march 2009

    Is there a way to do this? I have browsed the forum extensively but have not found any good answer. Tried changing the general-template.php file but that did not help. Also did not find any plugin that could help me with this issue.

    Any ideas on this?

  2. lola rennt
    Posted 11 months ago #

    I solved this problem by creating a list of posts using the get_posts tag and displaying only the_date from the posts. A little work around and not ideal, but it did the trick!

    $IDOutsideLoop = $post->ID;
    global $post;
    $args = array('numberposts' => 3 );
    $myposts = get_posts( $args );
    foreach( $myposts as $post ) :	setup_postdata($post); ?>
    	<li <?php if(is_single() && $IDOutsideLoop == $post->ID) {echo " class=\"current\"";}?>><a href="<?php the_permalink(); ?>"><?php the_date('d.m.Y'); ?></a></li>
    <?php endforeach; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic