• Skip to primary navigation
  • Skip to main content

Thats Journal

  • Home
  • About
  • Digital Marketing
    • Affiliate Marketing
    • Branding
    • Content Marketing
    • Email Marketing
    • Marketing
    • Sales and Marketing
    • SEO
  • Social Media
  • Influencers
  • Resources
  • WordPress
    • WordPress Plugins
    • WordPress Themes
  • Sitemap
  • Contact Us
  • Show Search
Hide Search

Add Adsense Ad Codes In .tpl Files Of PHP Link Directory

admin · Sep 3, 2013 · Leave a Comment

It is a bit tricky to add ad codes in PHP Link Directory (PHPld), phpbb, pligg or any other CMS which is using smarty templates. Smarty is actually a template engine which is used along with PHP. Smarty is used for keeping the functionality of the website separate from the design of the template. If you directly add the add codes in .tpl files (supported by smarty templates) you will get an error. It is because smarty templates won’t be able to translate the Javascript ad codes.

To add Adsense, Infolinks, Chitika, Bidvertiser, Media.net or any other affiliate marketing Javascript ad codes you have to put the codes inside a literal tag in your .tpl files:

{literal}
Your ad code goes here
{/literal}

For Example, if you wish to add ad codes in the header of your PHP link directory site, open file header.tpl (this would probably be located in directory/templates) by using notepad and add the ad codes in the format as given above (replace “Your ad code goes here” with your ad code) in the desired location. Now, import the file again to your site. Similarly, you can add the ad codes in any .tpl file like footer.tpl, sidebar.tpl etc.

Share this:

  • Click to share on Facebook (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • More
  • Click to print (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Pocket (Opens in new window)
  • Click to share on Telegram (Opens in new window)
  • Click to share on WhatsApp (Opens in new window)
  • Click to share on Skype (Opens in new window)

Related

Download thousands of Themes, Plugins & Graphics to create your Website. Use promo code ThatsJournal and get an additional 10% off for All MonsterONE Plans.

Ad Networks ad codes, advertisements, Bidvertiser, Chitika, CMS, design, engine, error, functionality, header, import, Infolinks, JavaScript, literal tag, making money online, Media.net, notepad, phpbb, phpLD, pligg, sidebar, smarty templates

About admin

Thanks for dropping by! This post was published by the Editorial Team of Thats Journal. Follow us on our social media channels for current trends on Digital Marketing, Social Media Marketing and WordPress Themes.

Disclosure: Thats Journal is supported by our readers. This page may contain affiliate links. That means, if you click on these links to make a purchase, we may earn a small commission (at no extra cost to you). These funds help us to keep this blog up and running.

Categories

Subscribe via Email

Enter your email address to subscribe to Thats Journal and receive new posts by email.

Join 38,252 other subscribers

Join Our Community of 50,000+ Bloggers And Authors!

Reader Interactions

Leave a Reply Cancel reply

Copyright © 2023 Thats Journal