• I’m wanting to fetch this rss feed https://www.sherdog.com/rss/news2.xml I have everything working but I can’t fetch the image. I took a look at the source and it has

    <content:encoded><![CDATA[<table><tr valign='top'>
    <td width='55' align='left'><a href='https://www.sherdog.com/news/news.asp?n_id=8918' target='_blank'><img src='https://www.cdn.sherdog.com/_images/news/2007_09/8918_sm.jpg' width='50' border='0'></a></td>
    <td><a href='https://www.sherdog.com/news/news.asp?n_id=8918' target='_blank'><b>UFC 75 "Champion Vs. Champion" Play-by-Play</b></a><br>Sherdog.com reports from the O2 Arena in London, England with live play-by-play of UFC 75 "Champion vs. Champion," which is headlined by <a href='https://www.sherdog.com/fightfinder/fightfinder.asp?fighterID=348'>Quinton Jackson</a> <span class='Txt9Gray'>(<a href='https://www.sherdog.com/news/picture_gallery.asp?f_id=348@@Quinton Jackson' class='LinkSilver'>Pictures</a>)</span> versus <a href='https://www.sherdog.com/fightfinder/fightfinder.asp?fighterID=195'>Dan Henderson</a> <span class='Txt9Gray'>(<a href='https://www.sherdog.com/news/picture_gallery.asp?f_id=195@@Dan Henderson' class='LinkSilver'>Pictures</a>)</span></td></tr></table>]]></content:encoded>

    I tried using <?php echo $item['content:encoded']; ?> but it doesn’t work. What would the echo variable be for this to echo properly? Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter invisionblue

    (@invisionblue)

    Here’s my full setup code…

    <?php // Get RSS Feed(s)
    include_once(ABSPATH . WPINC . '/rss.php');
    $rss = fetch_rss('https://www.sherdog.com/rss/news2.xml');
    $maxitems = 5;
    $items = array_slice($rss->items, 0, $maxitems);
    ?>
    
    <ul>
    <?php if (empty($items)) echo '<li>No items</li>';
    else
    foreach ( $items as $item ) : ?>
    <li><a href='<?php echo $item['link']; ?>'
    title='<?php echo $item['title']; ?>'>
    <?php echo $item['title']; ?>
    </a><br><?php echo $item['content:encoded']; ?></li>
    <?php endforeach; ?>
    </ul>
Viewing 1 replies (of 1 total)
  • The topic ‘How Would I Fetch This Using fetch_rss?’ is closed to new replies.