WordPress.org

Ready to get started?Download WordPress

Forums

Simplepie RSS (1 post)

  1. bcollery
    Member
    Posted 1 year ago #

    I'm using SimplePie to display an RSS feed in WordPress. For some reason the get_date() function is returning nothing? Here's my code below. Could it be an issue with my feed?

    [ Mod note: it's the backtick character for code not the single quote. Or use the code button, that works too. ]

    <h3><span class="dark-blue">news</span> & media</h3>
    
    <ul>
    <?php $feed = fetch_feed( 'http://dgpp.ie/dgppnews_rss.xml' );
    foreach ( $feed->get_items() as $item ) {
        printf( '
    <li><a href="%s"><strong>%s</strong></a>', $item->get_permalink(),
        $item->get_title() );
        printf( '<p>%s</p>', $item->get_description() );
        printf( '<p>%s</p>', $item->get_date() );
        printf( '<a href="%s">read more</a></li>
    ', $item->get_permalink() );
    }
    ?>
    </ul>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags