Halli Hallo,
vornweg einmal kurz ein teil des php-codes meiner index.php, damit ihr wisst, worum es geht :)
PHP
<div id="main">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h2>
<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
<div id="kommentare">
<?php comments_popup_link('Keine Kommentare', '1 Kommentar', '% Kommentare', '', 'Kommentare geschlossen'); ?>
</div>
<div id="meta">
<p>Datum: <?php the_date('d. M Y'); ?><br />Author: <?php the_author(); ?></p>
</div>
</h2>
<div class="entry">
<?php the_content(); ?>
</div>
<?php endwhile; endif; ?>
</div>
Alles anzeigen
wie ihr seht, habe ich oben in der titelzeile des artikels ein datum eingefügt, dass mir anzeigt, wann der artikel veröffentlicht wurde.. dabei gab es das problem, dass es bei artikeln, die am gleichen tag veröffentlich wurden, nur das datum des aktuellsten artikels angezeigt hat.
zur lösung des problems: (datei wp-includes/general-template.php um zeile 1350)
Code
function the_date( $d = '', $before = '', $after = '', $echo = true ) {
global $currentday, $previousday;
$the_date = '';
//if ( $currentday != $previousday ) {
$the_date .= $before;
$the_date .= get_the_date( $d );
$the_date .= $after;
$previousday = $currentday;
$the_date = apply_filters('the_date', $the_date, $d, $before, $after);
if ( $echo )
echo $the_date;
else
return $the_date;
//}
return null;
}
Alles anzeigen
ich habe den teil der if-abfrage auskommentiert, alternativ könnte man die abfrage natürlich auch löschen ;) aber dadurch wird für jeden artikel ein datum angezeigt.
gruß theiss