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 8455627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:19:56+00:00 2026-06-10T12:19:56+00:00

Working with WordPress on this. I’m using Magpie to grab an RSS feed, but

  • 0

Working with WordPress on this. I’m using Magpie to grab an RSS feed, but I only want it to display items that include a specific image. Here is the particular tag that I want to search for:

<media:thumbnail url="http://media.publicbroadcasting.net/wfpl/events/images/ourPick5.gif"/>

And here’s the specific code I’m using in this application. It’s basic, and I’m not incredibly adept at Magpie or PHP (I’m assuming there are more elegant ways of doing this for someone with a more robust knowledge of PHP):

<?php include_once(ABSPATH.WPINC.'/rss.php'); $feed = fetch_rss('http://www.publicbroadcasting.net/wfpl/.eventsfeed'); $items = array_slice($feed->items, 0, 4);?>

<?php if (!empty($items)) : ?>
<?php foreach ($items as $item) : ?>

<?php if (!preg_match('/<media:thumbnail\surl\="http:\/\/media.publicbroadcasting.net\/wfpl\/events\/images\/ourPick5.gif".+?>/i', $item['description'])) 
continue; ?>

    <li><a href="<?php echo $item['link']; ?>"><div class="item-headline"><?php echo $item['title']; ?></div>
    <div class="item-info"><?php echo $item['description']; ?>
    </div></a></li></ul>

<?php endforeach; ?>
<?php endif; ?>

Again, I only want to display the items with that specific image url in the “media:thumbnail” tag and discard all other items.

  • 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-06-10T12:19:58+00:00Added an answer on June 10, 2026 at 12:19 pm

    Add this part,

    <?php if (!preg_match('/<media:thumbnail\surl\="http:\/\/media.publicbroadcasting.net\/wfpl\/events\/images\/ourPick5.gif".+?>/i', $item['description'])) 
        continue; ?>
    

    before

    <li><a href="<?php echo $item['link']; ?>"><div class="item-headline"><?php echo $item['title']; ?></div>
        <div class="item-info"><?php echo $item['description']; ?>
        </div></a></li>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im working with wordpress and this function im using returns this or something that
I'm working on this website in WordPress and I want the content with the
All, I'm using wordpress with this and for some reason the eventDrop stopped working.
I'm pretty new to PHP, I'm working in WordPress but I don't think that
note: I'm working on wordpress but this isn't a wordpress question. I have a
This is my first time working with wordpress and I'm using the version 3.4.1.
please check this wordpress script for me, it is not working. I want to
First, I am using Wordpress for this project but I don't think this issue
I'm working on wordpress CMS website. Basically I want this website in 2 different
I could be way overthinking this but I'm working with Wordpress for the first

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.