• I have found the following script which shows me the last 10 posts.
    I’m trying to get the day (“the_time(‘l’)”) above the articles of each day in stead of in front of every separate line.

    So for example:
    Friday
    Article 7
    Article 6
    Article 5
    Thursday
    Article 4
    Article 3
    Wednesday
    Article 2
    Article 1

    How do I need to change the code to do that?

    <h2><?php _e(‘Last 10 Posts’); ?></h2>
    <?php
    query_posts(‘showposts=10’);
    ?>
    <table>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <tr>
    <td>[<?php the_time(‘l’) ?>]</td><td><?php the_time(‘H:i’) ?></td><td>“><?php the_title() ?> </td>
    </tr>
    <?php endwhile; endif; ?>
    </table>

Viewing 4 replies - 1 through 4 (of 4 total)
  • Ugh. tables. Well, something like this maybe?

    <h2><?php _e('Last 10 Posts'); ?></h2>
    <?php
    query_posts('showposts=10');
    ?>
    <table>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <tr>
    <td>[<?php the_time('l') ?>]</td><td><?php the_time('H:i') ?></td>
    </tr><tr>
    <td colspan="2"><?php the_title() ?> </td>
    </tr>
    <?php endwhile; endif; ?>
    </table>

    Thread Starter sequence

    (@sequence)

    this results in just having the day above _each_ line.

    right now i’m using this code:

    ##################
    <h2><?php _e(‘Last 10 Posts’); ?></h2>
    <?php query_posts(‘showposts=10’); ?>
    <table>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <tr><td>[<?php the_time(‘d-m’) ?>]</td><td><?php the_time(‘H:i’) ?></td><td><?php the_title() ?></td></tr>
    <?php endwhile; endif; ?>
    </table>
    ##################

    This results in the following output:

    ##################
    Last 10 Posts

    [04-06] 12:27 Article 10
    [03-06] 13:09 Article 9
    [03-06] 12:05 Article 8
    [03-06] 09:40 Article 7
    [02-06] 18:56 Article 6
    [02-06] 17:56 Article 5
    [02-06] 17:34 Article 4
    [02-06] 15:52 Article 3
    [02-06] 11:09 Article 2
    [02-06] 10:51 Article 1
    ##################

    But I want it to look like this:
    ##################
    Last 10 Posts

    Sunday
    12:27 Article 10
    Saturday
    13:09 Article 9
    12:05 Article 8
    09:40 Article 7
    Friday
    18:56 Article 6
    17:56 Article 5
    17:34 Article 4
    15:52 Article 3
    11:09 Article 2
    10:51 Article 1
    ##################

    Tnx in advance!

    Thread Starter sequence

    (@sequence)

    anybody?

    Thread Starter sequence

    (@sequence)

    would realy be helped if anybody could help me ajusting the code.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Last posts per day script ajustment’ is closed to new replies.