Weblog Archive

Dateline

Thu, 25 Sep 2008 at 12:10 • Chyetanya Kunte • Filed under Design, Usability

I’ve had the dateline sitting up there below every post title as mere information. This is how the dateline code looked on my site earlier.

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

I wrote a short piece of code to replace the above:

  1. // Get the post date
  2. <?php
  3. $arc_day = get_the_time('j');
  4. $arc_month = get_the_time('m');
  5. $arc_year = get_the_time('Y');
  6. ?>
  7. // Converting'em into linkable dates
  8. <?php the_time('l'); ?>,
  9. <a href="<?php echo get_day_link($arc_year, $arc_month, $arc_day); ?>"><?php the_time('jS') ?></a>
  10. <a href="<?php echo get_month_link($arc_year, $arc_month); ?>"><?php the_time('F') ?></a>
  11. <a href="<?php echo get_year_link($arc_year); ?>"><?php the_time('Y') ?></a>
  12. Download this example: /inputfiles/dateline.txt

It's fun to put your post related meta-data to work. Yes?

[ Ads ]

Related posts

Following list is auto-generated, based on this post's context as possibly related. You may, however, occasionally find some in this list unrelated, but nevertheless, we sincerely hope that you'll enjoy them too.

One response to “Dateline”

  1. Linkback: Changing the Dateline | DesiPundit