I am trying to add an rss feed to my site and when I use the wp_rss method like this:
<?php
require ABSPATH . WPINC . '/rss.php';
wp_rss ( 'http://miletich2.blogspot.com/feeds/posts/default?alt=rss', 5 )
?>
I get a massive error shown below:
Fatal error: Uncaught Error: Call to undefined function split() in /home/vagrant/Code/creativeforces/wp-includes/rss.php:117 Stack trace: #0 [internal function]: MagpieRSS->feed_start_element(Resource id #6, 'gd:image', Array) #1 /home/vagrant/Code/creativeforces/wp-includes/rss.php(84): xml_parse(Resource id #6, '<?xml version='...') #2 /home/vagrant/Code/creativeforces/wp-includes/rss.php(596): MagpieRSS->__construct('<?xml version='...') #3 /home/vagrant/Code/creativeforces/wp-includes/rss.php(495): _response_to_rss(Object(stdClass)) #4 /home/vagrant/Code/creativeforces/wp-includes/rss.php(901): fetch_rss('http://miletich...') #5 /home/vagrant/Code/creativeforces/wp-content/themes/creativeforces/page-media.php(30): wp_rss('http://miletich...', 5) #6 /home/vagrant/Code/creativeforces/wp-includes/template-loader.php(75): include('/home/vagrant/C...') #7 /home/vagrant/Code/creativeforces/wp-blog-header.php(19): require_once('/home/vagrant/C...') #8 /home/vagrant/Code/creativeforces/index.php(17): require('/home/vagrant/C. in /home/vagrant/Code/creativeforces/wp-includes/rss.php on line 117
I have no idea what to do from here. Any help would be appreciated!
split()
is not available in your PHP installation. It was removed in PHP 7.
You can verify this using the code below:
<?php
echo 'PHP version is '.phpversion().'<br><br>';
$funcs = get_defined_functions();
if(in_array('split', $funcs['internal']))
{
echo 'split() exists<br><br>';
}
else
{
echo 'split() does not exist<br><br>';
}
sort($funcs['internal']);
echo '<pre>'.print_r($funcs['internal'], true).'</pre>';