Results 1 to 5 of 5

Thread: Displaying Date in RSS Feed

  1. #1
    Join Date
    May 2005
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Displaying Date in RSS Feed

    Hi,

    I'm trying to use this script:
    http://www.dynamicdrive.com/dynamici...ybox/index.htm

    This is the RSS feed I've made (which I don't want to change):
    http://www.mattblank.com/rss/rss.xml

    And this is how it displays on the page:
    http://www.mattblank.com/rss/demo.htm

    Although I'm using the default template which therefore should show this:

    <DIV class="rsscontainer">
    <div class="rssdate"><?php echo $item->get_date(); ?></div>
    <div class="rsstitle"><a href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a></div>
    <div class="rssdescription"><?php echo $item->get_description(); ?></div><br/><br/>
    </DIV>

    It does not display the date.

    Can anyone help me please? It's really frustrating as I really want it to work, but don't want to change the way my RSS Feed is setup.

    Many thanks in advance,
    Matt

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    It does here.

    Quote Originally Posted by http://www.mattblank.com/rss/demo.htm
    26 January 2007, 12:00 am
    This Is My Title
    Here is my description


    25 January 2007, 12:00 am
    This Is My Title
    Here is my description


    24 January 2007, 12:00 am
    This Is My Title
    Here is my description


    23 January 2007, 12:00 am
    This Is My Title
    Here is my description


    22 January 2007, 12:00 am
    This Is My Title
    Here is my description
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    May 2005
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi John,

    Since posting I changed the RSS to say pubDate instead of Date and that then displayed it. But is it now possible to swap the date around, have a th/rd after the date and to NOT display the time?

    So instead of: 26 January 2007, 12:00 am
    To have: January 26th 2007

    Thanks!
    Matt

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'm not much up on PHP but, this (or similar) might do it:

    Code:
    <div class="rssdate"><?php echo $item->get_date('M d Y'); ?></div>
    The exact syntax in PHP may be different. To get the th or whatever (depending upon the date number) in there might be easier with javascript. You could also experiment with a capital D to see what value that returns (probably the Day name).
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    May 2005
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks John!! I played about with what you've suggested and figured it out.

    Many thanks for your help!
    Matt

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
  •