Moving Ads above RSS feed

david morgan Posted in General Discussion 3 years ago

I have the ads component and RSS feed component installed, but want to put the ads above the RSS feed. Can someone please advise me on the file path to navigate too in order to make my change

Replies
us Philip Lozier Replied 3 years ago

I agree with @David morgan! VERY helpful! I've been WANTING to do EXACTLY this, and this answer from @~Z~ Man... well... I wish I could get those kind of answer ALL the time! :)

Phil


gb David morgan Replied 3 years ago

Firstly, thank you for your time - It really is appreciated.

In regards to your solution, that has to be one of the clearest, most straight forward explanations ive received in a very, very long time.

Ive made the change, its worked, and I understand a bit more on how everything is structured.

Thanks you very much

Stay safe

German Michael Zülsdorff Replied 3 years ago

Before doing any changes: Disable Ossn cache on your admin backend!

Look into components/OssnAds/ossn_com.php
and find the line ossn_add_hook('newsfeed', "sidebar:right", 'ossn_ads_sidebar', 300);
The last parameter (300) shows the place number in a chain of widgets which will be added to the sidebar

Now look into components/RssFeed/ossn_com.php
and find the nearly similar line ossn_add_hook('newsfeed', "sidebar:right", 'com_rss_widget');
This time there's no place number at all - which means it defaults to 200 - and that's why the feed gets displayed BEFORE the ads.

Thus, all you have to do is giving the feed's hook a larger place number than 300, and it will be hooked in AFTER the ads, so change that line to ossn_add_hook('newsfeed', "sidebar:right", 'com_rss_widget', 301); and you're done.