Adsense - WordPress - Include File

by kah22
2 replies
  • SEO
  • |
Hi guys
I wonder if some Adsense people could help me with a problem.

I've just recently launched a blog and what I want to try and do is to place my adsense code within individual posts using an includes file, but I can't figure out how to achieve this.

It is easy enough placing an Adsense block at either the beginning or end of all posts by using an includes command in the singlepost.php.

At the same time it is also easy enough to manually place the code into each post but, if for whatever reason, you want to do a sitewide change you would have to undo each block separately, hence the reason I'm thinking of the includes option. In addition it will also give me greater control and ease of placement.

So anybody know how to do this? I've asked on the WordPress Forum and got one reply back which suggested it can't be done, the codex doesn't allow it, but that there was a plugin that could achieve the desired results. I've been unable to trace the plugin or confirm that WordPress codex won't let me use includes in the middle of a post - and to be honest I know little about coding, especially php.

So any suggestions.

Kevin
#adsense #file #include #wordpress
  • Profile picture of the author askloz
    if your wordpress blog has been set up to allow php code, then go into html mode and type

    Code:
    <?php
    include('name-of-file.php');
    ?>
    or simply post the text above into a file directly... or use Adsense Deluxe, something or another WP plugin, run a search for the best plugin at wordpress so you have more control over your ad placements and sizes, etc.
    Signature
    {{ DiscussionBoard.errors[403295].message }}
  • Profile picture of the author ryanmacca
    Yeh I don't know much about coding so I can't really help you....sorry bro
    Good luck
    {{ DiscussionBoard.errors[403783].message }}

Trending Topics