About this board

Place GoogleAdsense in the sidebar

2
Weejan91 (talkcontribs)

Hi Tilted Cerebellum,

I've seen that you've managed to manually place a Google AdSense ad into the footer of a MW page by using this code:

$wgHooks['SkinAfterContent'][] = function(&$data, $skin) {
	    $data = '<div class="gas-bottom">';
	    $data .= '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>';
		$data .= '<ins class="adsbygoogle gas-bottom-first"
            style="display:table; width:728px; height:90px; margin:1em auto; clear:both;"
            data-ad-client="ca-pub-XXXXXXXXXXXXXXXX"
            data-ad-slot="XXXXXXXXXX"></ins>';
		$data .= '<script>
        (adsbygoogle = window.adsbygoogle || []).push({});
        </script>';
		$data .= '</div>';
        return true;
};
## -- Adsense footer end -- ##

It works fine, thanks for that! Could you edit the code so I can use it in the sidebar also? I'm sitting for hours and am not able to manage this :-/ Thanks a lot!!!

TiltedCerebellum (talkcontribs)

Sorry, we ended up editing our skin to add that bit to the sidebar as hooks were always funky (we use a non-standard, non-MediaWiki skin). The drawback there is each time the skin is updated, we need to put the code back. It's definitely not ideal, but it works since most of the extensions have gone defunct.

Reply to "Place GoogleAdsense in the sidebar"
Summary by TiltedCerebellum

Request not related to me as just a MW user.

Sachinpatel393 (talkcontribs)

can we talk regarding this here for pages import and export related??

Please help me expedite T267132

2
Summary by TiltedCerebellum

Request not related to me as just a MW user.

Goodman Andrew (talkcontribs)

It's been >2month since reported, no one have said anything.

TiltedCerebellum (talkcontribs)

I'm just a user of the MediaWiki software like you, I can't help you to expedite anything I'm afraid.

Emailed Bham wiki about help link

2
MarkAHershberger (talkcontribs)

Just FYI, since you did the work of tracking down Bhamwiki for me, I asked them via their support email to update their help link.

TiltedCerebellum (talkcontribs)

That's a good idea, I'll start doing that also :)

Reply to "Emailed Bham wiki about help link"
There are no older topics