<?php // Get RSS Feed(s)
// Get a SimplePie feed object from the specified feed source.
$rss = fetch_feed( 'http://applythis.net/RaynerPersonnel/Search/rss/All/1' );
$maxitems = 0;
if ( ! is_wp_error( $rss ) ) : // Checks that the object is created correctly
// Figure out how many total items there are, but limit it to 4.
$maxitems = $rss->get_item_quantity( 4 );
// Build an array of all the items, starting with element 0 (first element).
$rss_items = $rss->get_items( 0, $maxitems );
endif;
?>
<div class="nJobs-container Jobs-container--alt">
<?php if ( $maxitems == 0 ) : ?>
<span><?php _e( 'No items', 'my-text-domain' ); ?></span>
<?php else : ?>
<?php // Loop through each feed item and display each item as a hyperlink. ?>
<?php foreach ( $rss_items as $item ) : ?>
<a href="<?php echo esc_url( $item->get_link() ); ?>"
title="rss feed" class="nJobs-job">
<span class="Jobs-role"><?php echo esc_html( $item->get_title() ); ?></span>
<span class="Jobs-readmore Button">More info</span>
</a>
<?php endforeach; ?>
<?php endif; ?>
</div>
Fatal error: Uncaught Error: Call to undefined function fetch_feed() in /in/8BXhg:4
Stack trace:
#0 {main}
thrown in /in/8BXhg on line 4
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Fatal error: Uncaught Error: Call to undefined function fetch_feed() in /in/8BXhg:4
Stack trace:
#0 {main}
thrown in /in/8BXhg on line 4
Process exited with code 255.
Output for 5.6.38
Fatal error: Call to undefined function fetch_feed() in /in/8BXhg on line 4
Process exited with code 255.