You are here:  » Adsense ads below api results

Support Forum



Adsense ads below api results

Submitted by johberg77 on Mon, 2013-06-24 23:16 in

Hi again,
My site is nearly done, but I want to add Adsense ads below API results on productpage, search result page and category page. Anyone knows how to do that? I have tried it in the footer, but the page is quite long and it will be too far below the fold.
Many thanks in advance.

Submitted by support on Tue, 2013-06-25 08:09

Hi,

If you create a .html file containing your AdSense code and save it s

wp-content/plugins/pto/resources/adsense.html

..then to include that on the page immediately below any content generated by an API call, edit pto_api.php and look for the following code beginning at line 32:

    if ($moduleResultsFunction())
    {
      $html .= $moduleTitleFunction();
      $html .= pto_search_html();
    }

...and REPLACE with:

    if ($moduleResultsFunction())
    {
      $html .= $moduleTitleFunction();
      $html .= pto_search_html();
    }
    $html .= file_get_contents("wp-content/plugins/pto/resources/adsense.html");

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by johberg77 on Tue, 2013-06-25 12:12

Ah, I forgot to tell you that I have 3 api running at the same time. So now Adsense are shown under each one. Can it be one to only be shown under the last api at the bottom?

John

Submitted by support on Tue, 2013-06-25 12:22

Ah right - no problem!

In place of the above modification, instead look for the following code at line 40 of pto_api.php:

  return $html;

...and REPLACE with:

  $html .= file_get_contents("wp-content/plugins/pto/resources/adsense.html");
  return $html;

...and it will only appear the once...!

Cheers,
David.
--
PriceTapestry.com

Submitted by johberg77 on Tue, 2013-06-25 13:28

Fantastic!

Thanks again!