WordPress.org

Ready to get started?Download WordPress

Forums

Grouping entries with the same date (7 posts)

  1. lynx13
    Member
    Posted 7 years ago #

    Hello!

    I am currently designing my archive-template and I want to group all the entries which were posted at the same date! I want to have the date of the latest posted entry from that day on top of it and the other entries divided with a horizontal line.

    How can I do this?

    Thank you very much!

    Sincerely,
    lynx

  2. moshu
    Member
    Posted 7 years ago #

    By archive-template did you mean the archive.php file?

    Anyway, have ever looked at the template tags used for displaying date/time?
    http://codex.wordpress.org/Template_Tags#Date_and_Time_tags
    Hint: the_date

  3. lynx13
    Member
    Posted 7 years ago #

    yes, I meant the "archive.php".

    I use the following command:

    "<?php the_time('l,') ?> <?php the_time('j. F Y') ?>"

    That is okay, but I don't know how to display e.g. three entries under the same date.

    greetings,
    lynx

  4. moshu
    Member
    Posted 7 years ago #

    Read again my post's last line and READ the documentation. Don't post back until you really read about the_date.

  5. lynx13
    Member
    Posted 7 years ago #

    okay.

    The Problem is:

    I wrapped "the_date" inside a table like:

    <table width="700" align="center">
    <tr bgcolor="#FFFFFF">
    <td>.<small><?php the_date('l, j. F Y'); ?></small>.</td>
    </tr>
    </table>

    Now, for every entry that is posted at the same day, there is an empty table! BUT
    my idea is: "Publish the date for the last entry that was posted that day and insert a horizontal rule between the other entries that were posted that day."

    Instead, wordpress inserts this table and that is annoying.

    Another hint? Maybe? :)

    Thanx anyway!

  6. moshu
    Member
    Posted 7 years ago #

    Hint? Don't use tables :)

  7. lynx13
    Member
    Posted 7 years ago #

    Well, does nobody know how I could solve this problem?

    Again:

    I'm using "<?php the_date('l, j. F Y'); ?>" in my archive.php. This means that WordPress only displays "<?php the_date('l, j. F Y'); ?>" once if there were more than one entry at that day. I really don't like the style of "<?php the_date('l, j. F "Y'); ?>", so I want to insert the following:

    "<table width="700" align="center">
    <tr bgcolor="#FFFFFF">
    <td><img src="http://www.doamin.com/images/sample.jpg" width="20" height="20" alt="sample" title="sample"/>
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif"><B>.<small>"

    before

    "<?php the_date('l, j. F Y'); ?>"

    and

    "</small>.</B></font></td>
    </tr>
    </table>"

    after "<?php the_date('l, j. F Y'); ?>".

    Unfortunately now there is an empty table everywhere the date was ignored because of the "one-date-per-multiple-entries"-rule.

    How can I solve this?

    Yours sincerely,
    lynx

Topic Closed

This topic has been closed to new replies.

About this Topic