To add your own business news feed RSS url follow this steps:
Go to application/helpers/my_functions_helper.php and add this line:
1 2 3 4 5 6 7 8 |
function add_bn_site($sites){ $sites[] = array( 'name'=>'SEO', 'feed_url'=>'https://domain.com/rss-feed/', ); return $sites; } add_action('before_get_rss_feeds','add_bn_site'); |
Change the url according to your needs.
If you want to add multiple URLs you only need to copy this part:
1 2 3 4 |
$sites[] = array( 'name'=>'SEO', 'feed_url'=>'https://my-other-domain-.com/rss-feed/', ); |
In this example we are adding 2 RSS feed sites. Which now the full code will be like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
function add_bn_site($sites){ $sites[] = array( 'name'=>'Other URL', 'feed_url'=>'https://domain.com/rss-feed/', ); $sites[] = array( 'name'=>'SEO', 'feed_url'=>'https://my-other-domain-.com/rss-feed/', ); return $sites; } add_action('before_get_rss_feeds','add_bn_site'); |
Unsetting existing RSS Feed urls
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
function add_bn_site($sites){ $sites[] = array( 'name'=>'SEO', 'feed_url'=>'https://domain.com/rss-feed/', ); $i = 0; foreach($sites as $site){ if($site['name'] == 'Forbes'){ unset($sites[$i]); } $i++; } $sites =array_values($sites); return $sites; } add_action('before_get_rss_feeds','add_bn_site'); |
NOTE: The url must be RSS Feed url