Aside formatting and date display issue
-
I’m having some problems getting my Asides code to work properly. I’m using a slightly modified version of Matt’s Asides and Dean J. Robinson’s Redoable theme. I tinkered with his template so that my posts with the category are published as his ‘linklog’ entries were. This means that my Asides are findable with the search function, as his linklog entries were not.
Anyway, here’s the first question. It may be a fix quick that I’m just too boneheaded to figure out. All of the dates that are being shown for my Asides entries are the present date, not the date on which they were published. Take a look at my index page (https://www.digenis.org) to see what I mean.
Here’s what the code looks like:
<?php if ($posts) { function stupid_hack($str) { return preg_replace('|</ul>\s*<ul class="linklog">|', '', $str); } ob_start('stupid_hack'); foreach($posts as $post) { start_wp(); ?> <?php if ( in_category(14) && !is_single() ) : ?> <div class="lentry"> <div class="published_link"><?php echo date('d/m', strtotime($post->date_added)) ?></div> <div id="link-<?php the_ID(); ?>" class="link-title"> <?php echo wptexturize($post->post_content); ?> <?php comments_popup_link('(0)', '(1)', '(%)')?></div><div class="link-header">ASIDES</div></div> <?php else: // If it's a regular post or a permalink page ?> ...
Any clues as to what I’ve done wrong? I want the date to be formatted just as it is now, but for it to display when the post was published.
- The topic ‘Aside formatting and date display issue’ is closed to new replies.