Support » Fixing WordPress » probably easy: date sub-headings?

  • i can’t figure this out, but it should be easy? i think in MT this was called a “date header”

    i am not using a date archive, i just want a category template to list all posts for that category, and create date headings…

    september 05
    – entry title
    – entry title etc etc

    october 05
    – entry title
    – entry title etc etc

    again, this is not a ‘date archive’

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try this ?

    Plugin Name: SPS-Archives 1.0 PR
    Plugin URI:
    Description: The plug-in will show your archives by month/year by default and has the facility to be switched to category view.
    Version: 1.0 PR
    Author: Steve P. Sharpe
    Author URI:
    Call funtion on page by using the following code <?php get_sps_archives(); ?>


    found the plugin here:
    found here:
    looks like that developer is using other software. “Powered by EE 1.3” and he’s not officially hosting the plugin anymore. but i’ll give it a try right now.

    just in case anyone is wondering, yes, i did try the single_month_title(); which would work for anyone who was using date archive pages.

    it looks like all date tags only work on date archives? not on category template, etc.

    is that a bug or a feature?

    that plugin only works for date archives.

    anyway, this seems crazy that you can’t use the date header on non-date archive pages and within the loop to group elements by day, month, etc.. i guess i’m used to the way MT (movable type) use a date header.

    here’s how to group by day:

    i modified this to group by month. i’m using mine on a custom category template that is displaying festivals for an entire year. with month sub-headings. so i’ll include the entire loop from the top with the query_posts function, in case it can be of use to anyone.

    $current_year = date('Y');

    <h2 class="pagetitle">Festivals and start dates - <?php echo ($current_year); ?> </h2>

    <?php query_posts("cat=23&year=$current_year&order=ASC"); ?>

    <?php if (have_posts()) :
    $last_month = false;
    while (have_posts()) : the_post();
    if (!$last_month) {
    the_date('F Y', '<h2 class="date"> ','</h2>');
    $last_month = get_the_time('F-Y');
    } elseif ($last_month != get_the_time('F-Y')) {
    the_date('F Y', '<h2 class="date">','</h2>');
    $last_month = get_the_time('F-Y');

    <!-- entry stuff here -->
    <h3><?php the_title(); ?> </h3>
    <?php edit_post_link('(edit this) ', '', ''); ?>
    <?php the_content(); ?>

    Start Time: <?php the_time('j F Y, G:i'); ?>
    <?php endwhile; ?>
    <?php else : ?><br />
    <h2><span>Not Found</span></h2><br />
    <?php endif; ?>

    totally loopy, but it works.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘probably easy: date sub-headings?’ is closed to new replies.