WordPress.org

Support

Support » How-To and Troubleshooting » Show month/year in archive title

Show month/year in archive title

Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael

    @alchymyth

    Forum Moderator

    some useful code is at the top of archive.php of Twenty Ten;

    simplified and re-written for use in header.php for the <title>:

    <?php if ( have_posts() ) 	the_post();
    if ( is_month() ) : echo get_the_date( 'F Y' );
    elseif ( is_year() ) : echo get_the_date( 'Y' );
    rewind_posts(); ?>

    http://codex.wordpress.org/Conditional_Tags

    Thanks. I’ll look and adapt what I can.

    The problem arose because I’d used conditional titles, and had incorrectly coded with the effect of removing the year/month on archives, and just couldn’t see how to re-add them.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show month/year in archive title’ is closed to new replies.
Skip to toolbar