Manually editing ads into wordpress themes?

by humbledmarket Banned
5 replies
Hello Warriors,
I have quite a few wordpress sites such as Tv Stands for LCD Tvs and I would like to place ads into the content itself.

I see some sites with ads in the content on the top left corner of the article and would really like to do this as well.

Can someone kindly let me know how to add adsense blocks into the top left corner of the content or in the bid paragraph?

Thanks very much in advance.

Best Regards,
Benjamin
#ads #editing #manually #themes #wordpress
  • Profile picture of the author Happy_Balance
    Hi Benjamin,

    Simple answer:
    You can insert the Adsense code manually or use one of several plugins.

    More info:
    My experience with this is ~1.5 years ago.
    If I was doing it today I would search for the latest updates of "Wordpress Adsense Plugins"
    Signature

    Every Day Is Fun! :)

    {{ DiscussionBoard.errors[3584272].message }}
  • Profile picture of the author teecamo
    Depends on your theme. Go into Appearence->Editor and start searching for the right file...probably header.php

    This might take some time, but its doable.
    {{ DiscussionBoard.errors[3585190].message }}
  • Profile picture of the author phpdev
    Signature
    Ali Usman
    PHP, MySql, WordPress, API Programming, E-Commerce Site, Payment Integration, Twilio, SMS Marketing, Custom Development, Wordpress, Joomla, Interspire, BigCommerce, Volusion, 3dCart and many more...
    sales@bluecomp.net
    {{ DiscussionBoard.errors[3585273].message }}
  • Profile picture of the author 1babywarrior
    Yes, definitely can be done via plugin or manually by copy and paste into the WP template files. Personally I prefer the manual method for better performance and less dependencies.
    {{ DiscussionBoard.errors[3592244].message }}
  • Profile picture of the author Christian Little
    The easiest way would be to use a plugin, but if you just want to insert a simple ad box at the top of every post, you can do this:

    Appearance -> Editor -> Single.php (or index.php depending on how your theme is setup)

    Look for the start of the wordpress loop, which looks something like this:

    Code:
    while(have posts)...
    Right below that you should see something like this (varies depending on the theme):

    Code:
    <h1><?php the_title(); /></h1>
    <?php the_content(); ?>
    What you want to do is insert a simple div between those 2 lines that wraps around some kind of php include:

    Code:
    <h1><?php the_title(); /></h1>
    <div style="float: right; width: 300px;"><?php include('http://www.mysite.com/ad.php'); ?></div>
    <?php the_content(); ?>
    Then create ad.php on your site and put your ad code into it, i.e.:

    Code:
    <a href="#"><img src="whatever" /></a>
    Voila! Your blog now displays an ad at the top of every blog post, and you can just change ad.php to change what ad is shown across all pages.
    {{ DiscussionBoard.errors[3592414].message }}

Trending Topics