WordPress.org

Ready to get started?Download WordPress

Forums

PHP help: How to code headers on archive pages... (8 posts)

  1. nickaster
    Member
    Posted 2 years ago #

    Hi there... looking for some generic code to make a monthly archive look like this:

    DATE (00.00.00)
    Headline 1
    Headline 2
    Headline 3
    DATE 2 (00.00.00)
    Headline 1
    Headline 2
    Headline 3
    .
    .
    .

    Pretty simple... I just can't figure out the code to make the daily headers sit in there. Anyone have some example code for this?

  2. nickaster
    Member
    Posted 2 years ago #

    For reference... this is what I'm working with:

    http://www.triplepundit.com/2012/01/

    Just trying to figure out how to get dates in there!

  3. nickaster
    Member
    Posted 2 years ago #

    This must be pretty basic... anyone got an idea?

  4. Jose Castaneda
    Member
    Posted 2 years ago #

    You are wanting an unordered list inside the loop to look something like this:
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    Hope that help a little.

  5. nickaster
    Member
    Posted 2 years ago #

    That looks great, but what about the date headers? That's the part I can't figure out...

  6. hockeyhero4
    Member
    Posted 2 years ago #

    Is this what you're looking for?

    <?php the_date('Y-m-d', '<h4><a href="www.yourdomain.com" title="Alt Title">Text if you want to link it</a>', '</h4>'); ?>

  7. nickaster
    Member
    Posted 2 years ago #

    hmmm.. i don't think so... what would that do exactly?

    I'm just looking to have a list of posts on my monthly archives that breaks them up by day. Like this:

    *** Monthly Archive for February 2012 ****

    ***Feb 1***
    Headline 1
    Headline 2
    Headline 3
    ***Feb 2***
    Headline 1
    Headline 2
    Headline 3
    .... etc....

  8. nickaster
    Member
    Posted 2 years ago #

    any concepts here?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.