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 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

Ask A Question

Stats

  • Questions 391k
  • Answers 391k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It depends on what those models are doing. If they… May 15, 2026 at 1:26 am
  • Editorial Team
    Editorial Team added an answer I prefer the first style, except that I wouldn't create… May 15, 2026 at 1:26 am
  • Editorial Team
    Editorial Team added an answer int i = 0, cap = 10; int *a =… May 15, 2026 at 1:26 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.