Add Google Adsense Link Unit In Header

Edit This Page

Majority of bloggers and other content based sites rely on Google Ad-sense for generating revenues through their websites. And it’s a good practice to blend the Google ads with the site’s content.

Here, in this post, we will be demonstrating the addition of Google Ad-sense Link unit in the header section of the rtPanel child theme, which looks some thing like we have done in the Devils’ Workshop.

All you need to do is,

In the rtPanel child theme, you will find the ‘lib’ directory. Open the rtp-custom-hooks-applied.php file in the ‘lib’ directory and create a function something like:

function rtp_google_ad_link_header() {
  echo $google_ad_unit;

Next, we create the action at the appropriate hook. Going specific to the current topic, we want the Google Ad Link Unit to be added up in the header section after the logo. So I proceed as:


There it is! We have successfully added the Google Ad Link Unit in the header. Further blending with the content can be easily handled using CSS.

For any doubt about adding Google Ad Link Unit to your rtPanel theme, ask your questions on our support forum.