PHP code example of baraja-core / wordpress-post-feed

1. Go to this page and download the library: Download baraja-core/wordpress-post-feed library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

baraja-core / wordpress-post-feed example snippets


$feed = new \Baraja\WordPressPostFeed\Feed;

$feed = new \Baraja\WordPressPostFeed\Feed;

$posts = $feed->load('https://blog.mycleverminds.cz/feed/');

foreach ($posts as $post) {
    echo $post->getTitle();
    echo $post->getDescription();
    echo $post->getLink();
    echo $post->getDate()->format('Y-m-d');
    echo $post->getCreator();
    echo json_encode($post->getCategories());
    echo $post->getMainImageUrl();
}

$posts = $feed->load(
    url: 'https://blog.mycleverminds.cz/feed/',
    limit: 3,
    offset: 1,
);

$feed = new \Baraja\WordPressPostFeed\Feed;
$feed->updateCache('https://blog.mycleverminds.cz/feed/');