If files are on the same server & you want to load them from the wordpress environment(using wordpress functions), you can include wp-load.php
which will load all wordpress files & then use WP_Query
, get_posts
etc. This is dirty but gets the job done
If you have the database accessible, you can write custom queries to the database, this will be most efficient but you won’t have any wordpress filters applied
It’s possible via feed as well, see this example
<?php
$doc = new DOMDocument();
$doc->load('< feed url here >');
$arrFeeds = array();
foreach ($doc->getElementsByTagName('item') as $node) {
$itemRSS = array (
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue
);
array_push($arrFeeds, $itemRSS);
}
var_dump($arrFeeds);
?>
or use curl to read feeds, there are tutorials easily available online