SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist
    Join Date
    Feb 2005
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    help displaying date for each post in wordpress

    Hi. Am setting up my blog using wordpress. Want to display the date for each post I create. Does anyone know how I can achieve this please. thanks

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,189
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)

    Post dates

    If you log in and go to Settings -> General, there are options to format the Date and Time. For example, mine are:
    Date Format F j, Y
    Output: April 27, 2008
    Time Format g:i a
    Output: 6:46 pm
    But this alone may not be enough. You should also look at your theme's template files. For example, my index.php file has:
    PHP Code:
    <div class="entry-date">
    <abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO'); ?>"><?php unset($previousday); printf(__('%1$s – %2$s''sandbox'), the_date(''''''false), get_the_time()) ?>
    </abbr></div>
    and displays like:
    April 15, 2008 – 11:35 pm
    In other words, the theme files needs to have the_date() in it for it to show.

  3. #3
    SitePoint Evangelist
    Join Date
    Feb 2005
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cheers for that Mittineague. I have seen wordpress blogs with the dates displayed for each date with styled boxes i.e. red box background with the date in the box. Is this done by css styling. Is there anything out there that can help me achieve what i am after

  4. #4
    SitePoint Addict BlazeMiskulin's Avatar
    Join Date
    May 2007
    Location
    Wisconsin
    Posts
    330
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd suggest finding a theme (or themes) which does what you want. Download it and look at the CSS tags on the date (either "class" or "id") then look in the style.css file to see how it's accomplished.
    M Blaze Miskulin
    President
    Geek Niche Web Hosting


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •