Weblog Archive

Dateline

Thursday, 25 September 2008

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?

One response to “Dateline”

  1. Linkback: Changing the Dateline | DesiPundit
Previous in categoryNext in category
India’s fast lane Software an endless frontier
ProjectsArchivesColophon© 2002–9 Chyetanya Kunte