heather16
Member
Posted 3 years ago #
I want to add AdSense to the bottom of the posts on the main page but do I add that to the Home or Index file? Also, I looked into some of the posts but none of the places I put the code worked.
So which file shold I change and where exactly do I put it?
lalindsey
Member
Posted 3 years ago #
First - what theme are you using? I haven't seen a home.php before...
Either way you want the adsense to display after all the posts on your main page?
To do that you would edit "index.php". After the call for the entry, you would place the adsense code.
heather16
Member
Posted 3 years ago #
I'm using blog.txt and have tried to put the code everywhere in the Index.php it seems. What exactly is the code for "the call for the entry"?
And yes, I'd like it to display after each entry.
Thanks!
@heather16 - See if this little tutorial would help you: http://www.tamba2.org.uk/wordpress/adsense/
@lalindsey - see the Template_Hierarchy page for more on home.php. It isn't overly common, but it is a valid theme page.
heather16
Member
Posted 3 years ago #
Actually, I went through that tutorial before I posted ;-)
I put the code where it suggested but it doesn't show. I don't know what the heck is going on.
Without a link to see that in action, we don't know what's going on either! *cough* hint *cough* ;-)
heather16
Member
Posted 3 years ago #
Hee-hee...heathereagar.com
I have it on the individual post pages now but that's it.
Ok, and I see it working on the individual posts fine.
I don't see any hint that it might be in index.php. I guess I'd suggest you hit that tutorial again, add the ads back to index.php and then post back so we can have a look.
heather16
Member
Posted 3 years ago #
Okay, I added the code back in. See what you think!
Oh, and the single.php isn't the problem. Already have that ;-)
Hrmm... which file did you add the ads too? Index or Home?
Can you give a bit of a copy/paste a bit before and abit after of where you added the ad code?
heather16
Member
Posted 3 years ago #
I added it to the Index page...This is just one of the many places I added it. The only place I have "sidebar" as per the tutorial is at the very bottom of the inndex.php and that didn't work either.
<?php the_content('<span class="more-link">Continue Reading »</span>'); ?>
<?php link_pages('<p class="paged-link">Pages: ', '', 'number');
[Adsense]
</div><!-- END POST-ENTRY -->
<p class="post-footer">¶ Posted "
I'm assuming that [Adsense] represents all the adsense code.
Humor me for a minute and rename home.php to notHome.php. Head back to your site and refresh.