cplummer4
Member
Posted 9 months ago #
Hello,
The current 'filter' option appears to allow keyword filtering on 'items'. Each item includes both the title and description fields. Is there a way to filter by titles only?
I'm wanting to provide 5 filtered views of the same RSS feed for a radio blog. They are consistent with naming the radio show titles. However, sometimes they talk about other radio shows within the description of a particular show. So the filtering mechanism is breaking down.
Thanks,
Casey
http://wordpress.org/extend/plugins/hungryfeed/
cplummer4
Member
Posted 9 months ago #
I was able to fix this, but I only needed to filter by titles, and didn't care about descriptions.
Edit hungryfeed.php:
// if any filters were specified, then only show the feed items that contain the filter text
if (count($filters))
{
$match = false;
$item_will_be_included = false;
foreach($filters as $f)
{
// Filter on titles only
// if (stripos($description,$f) !== false || stripos($title,$f) !== false)
if (stripos($title,$f) !== false)
{
$match = true;
break;
}
}
if (!$match)
{
// didn't match the filter, exit the foreach loop
continue;
}
}
looks good, an improvement that might make sense for a future version would be to add that in as a parameter like "filter_title_only"