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

  • Home
  • SEARCH
  • 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 773289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:56:27+00:00 2026-05-14T18:56:27+00:00

Does anyone know how to do this? I know how to display a single

  • 0

Does anyone know how to do this? I know how to display a single feed as a simple list, but it gets more complicated. I want to display a list but have multiple sources, with each source having the list-style-image be specific.

Example:

(img1) This is data from rss feed 1
(img2) This is data from rss feed 2

Thanks so much for the help!

This is what I have for a single source list.

# INSTANTIATE CURL.
$curl = curl_init();

# CURL SETTINGS.
curl_setopt($curl, CURLOPT_URL, "RSSURL");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0);

# GRAB THE XML FILE.
$xmlTwitter = curl_exec($curl);

curl_close($curl);

# SET UP XML OBJECT.
$xmlObjTwitter = simplexml_load_string( $xmlTwitter );

$tempCounter = 0;

foreach ( $xmlObjTwitter->channel->item as $item )
{                    
    # DISPLAY ONLY 10 ITEMS.
    if ( $tempCounter < 11 )
    {
        echo "<li><a href=\"{$item -> guid}\">{$item -> title}</a></li>
";
    }

    $tempCounter += 1;
}

EDIT 1

Alright, Thanks a lot. Very helpful. I’ve attempted to implement it by:
1. Installing SimplePie into the root of my site in the PHP folder.
2. Implenting the given code. (No styling yet, want to get it functional first.)

My code currently is this:

<?php
require_once('/simplepie.inc');

$feed = new SimplePie();
$feed->set_feed_url(array('rss1', 'rss2'));
$feed->init();
$feed->handle_content_type();
foreach ($feed->get_items(0, 100) as $item) {
    $n = array_search($item->get_feed(), $feeds);
    echo '<li class="feed'.$n.'">'.$item->get_title().'</li>';
}
?>\

I’m getting this output on my site:

set_feed_url(array(‘http://vimeo.com/user/likes/rss‘,
‘http://vimeo.com/user/videos/rss‘));
$feed->init();
$feed->handle_content_type(); foreach
($feed->get_items(0, 100) as $item) {
$n = array_search($item->get_feed(),
$feeds); echo ‘ ‘.$item->get_title().’
‘; } ?>\

I’m obviously doing something wrong, but am having trouble discovering what it is.
Thanks again.

  • 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-14T18:56:27+00:00Added an answer on May 14, 2026 at 6:56 pm

    It seems that you have two problems: aggregating multiple RSS feeds and then displaying them in a list.

    1: Use SimplePie lib — probably the simplest and best one for anything related to RSS. Might seem as an overkill for someone because of the file size, but anyway. It will also handle sorting by date for you. http://simplepie.org/

    <?php
    $feed = new SimplePie();
    $feed->set_feed_url(array('http://rss1', 'http://rss2'));
    $feed->init();
    $feed->handle_content_type();
    foreach($feed->get_items(0, 100) as $item) {
        $n = array_search($item->get_feed(), $feeds);
        echo '<li class="feed'.$n.'">'.$item->get_title().'</li>';
    }
    ?>
    

    2: What akamike said (and deleted?), but list style images can be a pain — almost impossible to align. A more flexible solution would be to remove them and use background.

    CSS:

    li.feed1, li.feed2 {
        list-style: none;
        background-position: left center;
        background-repeat: no-repeat; 
    }
    
    li.feed1 { background-image: url(feed1icon.png); }
    li.feed2 { background-image: url(feed2icon.png); }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know what this means. Getting this in C# winforms applications: Not a
Does anyone know what this value is for? If it is set to 1,
I cannot find this in the documentation anywhere. Does anyone know if this is
Does anyone know what is wrong with this query? SELECT DISTINCT c.CN as ClaimNumber,
Does anyone know how to turn this string: Smith, John R Into this string:
does anyone know if you can do something like this using the (N)Hibernate criteria
Does anyone know of crossbrowser equivalent of explicitOriginalTarget event parameter? This parameter is Mozilla
Does anyone know? And a bigger question is what happens when you encounter this
Does anyone know how to change the brush for a menu's background? This sounds
Anyone know this compiler feature? It seems GCC support that. How does it work?

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.