Santosh Kumar Santosh Kumar - 1 year ago 47
PHP Question

How to exclude posts that are categorized as "Tutorials" from RSS feed?

What I am doing is parsing RSS feed of a WordPress blog and getting information as

, and
from the XML file.

$html = "";
$url = "";
$xml = simplexml_load_file($url);

for ($i = 0; $i < 5; $i++) {
$title = $xml->channel->item[$i]->title;
$link = $xml->channel->item[$i]->link;
$description = $xml->channel->item[$i]->description;
$pubDate = $xml->channel->item[$i]->pubDate;

$html .= "<a href='$link'><h3>$title</h3></a>";
$html .= "$description";
// $html .= "$pubDate";
echo $html;

Sorry for the bad markup, but that's it.

The thing is, I don't want to post tagged as "Tutorials" to show in the rendered HMTL file. I'm not sure how to get it done.

Answer Source

Try url like : Here 5 is your "tutorials" category id

for more see: