Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6861799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:34:54+00:00 2026-05-27T02:34:54+00:00

I have a simple RSS feed coming in my WordPress site with php, but

  • 0

I have a simple RSS feed coming in my WordPress site with php, but need to style and format it. And am particularly struggling with formatting the ‘time stamp’.

Below is my code, any help is awesome –

PHP at the top of doc.

<?php
$doc = new DOMDocument();
$feedURL = 'http://www.mysite.net/feed/';
$doc->load($feedURL);
//$doc->setEncoding("UTF8");
$itemsArray = array();

$items = $doc->getElementsByTagName( "item" );
$itemCounter = 0;
foreach($items as $item) {
    $titleInfo = array();
    $titles = $item->getElementsByTagName( "title" );
    $title = $titles->item(0)->nodeValue;

    $timestamps = $item->getElementsByTagName( "pubDate" );
    $timestamp = $timestamps->item(0)->nodeValue;   

    $totalItems = 4;
    if($itemCounter < $totalItems) {                
        $links = $item->getElementsByTagName("link");
        $link = $links->item(0)->nodeValue;                     
        array_push($titleInfo, $title, $link,  $timestamp, $itemCounter);  
        array_push($itemsArray, $titleInfo);
        $itemCounter++;                         
        }
}

?>

<?php
    include('../includes/db-connect.php');
    include('../includes/queries.php');
    include('../includes/imprintArray.php');        
    $imprintChoice = 'tenspeed';
    $imprintVar = $imprintChoice;
    $shortImprint = $imprintarray[$imprintChoice]["shortImprint"];
    $imprintCode = $imprintarray[$imprintChoice]["imprintCode"];
    $imprintName = $imprintarray[$imprintChoice]["imprintName"];
    $imprintColor = $imprintarray[$imprintChoice]["imprintColor"];
    $results_sort='pub_date';
?>

Below is the mark-up:

<!--New RC feed area 1121-->

        <div id="RCbox" style="height:auto; width:100%; background-color:#fff;">

        <div class="rightside_titlebox" style=" width: 100%; background: none repeat scroll 0% 0% rgb(255, 159, 35);">
        <h1 class="rightside_title">Latest from Recipe Club</h1>
        </div> 

        <div style="float:left; width:360px; padding:10px; line-height:25px;">


   <a href="<?php echo $titleInfo[1]; //LINK ?>" style="color: #466289; font-weight: bold;"><?php echo $titleInfo[0]; //POST TITLE ?></a></p><br />

   <?php
    foreach($itemsArray as $titleInfo) {            
        ?><br />            
       <p><?php echo $titleInfo[2];//TIMESTAMP ?>         
        <?php } ?>



        </div>

        <div style="float:right; width: 360px; text-align:center;"> 

        <p style="margin-top:-80px;">[ Logo Here ]</p>

        </div>           

        </div>

        <br />

        <!--End RC area-->

The feeds working, but appears looking like:

Tue, 29 Nov 2011 15:07:22 +0000 Pasta Ponza from Giada at Home

And I’d like it to be formatted like:

Posted on November 29th, 2011

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:34:55+00:00Added an answer on May 27, 2026 at 2:34 am

    You’re simply outputting the exact value from the feed.

    You’ll want to convert it first, with something like :

    $timestamp = date('F jS, Y', strtotime($timestamps->item(0)->nodeValue));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have successfully created a simple RSS feed, but entries keep coming back as
Any example on how to parse/have access to simple RSS feed elements in JS?
I'm reading a rss feed using simple code: <?php $homepage = file_get_contents('http://www.forbes.com/news/index.xml'); $movies =
I have an RSS feed that I'm setting up on my new site using
I have simple form. <form target=_blank action=somescript.php method=Post id=simpleForm> <input type=hidden name=url value=http://...> <input
I have an XML file taken from an RSS feed, saved locally, and I
I'm working on a site with a simple php-generated twitter box with user timeline
I have a RSS feed generated by my server ( for example : http://www.seek-team.com/en/teams/counter-strike-source/feed/
I have a fairly simple process running that periodically pulls RSS feeds and updates
I have the following rss feed which I would like to query to get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.