WordPress.org

Ready to get started?Download WordPress

Forums

RSS Fetch Parameters and Excerpt issue (1 post)

  1. Diesel12
    Member
    Posted 6 years ago #

    I'm fetching an rss feed, but need a little help with making sure all entries are excerpts. Most come as excerpts some are full posts.... I'm pulling the rss feed from yahoo pipes, so possibly that is the problem?

    Also wondering how to choose different date output such as 12 hour time as opposed to 24 hour time and switching day and month so they are not European style..... easy enough with php, but not finding any guides for rss....

    Am also wondering about the best way to list the source url, "source" doesn't seem to work for me.... any feedback appreciated!

    The code I'm using to pull RSS:

    <?php
    require_once (ABSPATH . WPINC . '/rss-functions.php');
    $url = 'http://pipes.yahoo.com/pipes/pipe.run?_id=03e197a24cb3885e152686713f0cf76f&_render=rss';
    $rss = fetch_rss( $url );
    if ( $rss ) {
    echo "<h4>" . $rss->channel[''] . "</h4>";
    $i = 25;
    foreach ($rss->items as $item) {
    $href = $item['link'];
    $title = $item['title'];
    $pubdate = $item['pubdate'];
    $description = $item['description'];
    echo "<span style=\"font-size:14px; font-weight: bold;\"><a href=\"$href\">$title</a></span>";
    echo "<strong>$pubdate</strong>";
    echo "<div style=\"padding:0 0 15px 5px\">$description</div>";
    if ($i == 1 ) break;
    $i = $i + 1;
    }}?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags