Recent Topics

1 Feb 09, 2009 17:39    

My b2evolution Version: 2.x

Where do I paste Google Adsense code so it appears under the header of every blog page?

4 Feb 09, 2009 18:00

As I understand it, the Adsense plugin is used to place the ads within blog postings. I would rather paste the code into one of the php files, if that is possible, so the ads appear above the area where the blog posting appear.

I have seen discussions about placing add code in the sidebar by pasting it in blogs/skins/myskin/index.php, but my 2.2.6 does not have that php file. It has index.main.php, page.main.php, etc. I have tried pasting code there, but it does not seem to appear on my blog pages.

5 Feb 09, 2009 18:05

Put the Adsense code in a FreeHTML widget if you want to place it in the sidebar.
If you want it in the skin, crack open /skins/yourskin/_posts.main.php or /index.main.php (depending on skin) and put it under the header, e.g. where you find this line

<!-- =================================== START OF MAIN AREA =================================== -->


or a little down if you want that.

Good luck

6 Feb 09, 2009 18:16

Thanks for the help, but I am still having problems.

I have searched these files:

blogs/skins/evopress/index.main.php
blogs/skins/evopress/page.main.php
blogs/skins/evopress/posts.main.php

But I do not find

<!-- =================================== START OF MAIN AREA =================================== -->

anywhere in them.

7 Feb 09, 2009 18:19

Can you find this or something similar?

<div class="bPosts">


Try just before or just after. I think just after is a little nicer, but simply try.
Oh, and the file is probably posts.main.php from Asevo or Simple Zen skin (likely).

Good luck

8 Feb 10, 2009 19:24

Thanks for your help. The Adsense ad is now working. The ads are horizontal and appear directly below the small menu (Home Contact Login) which is directly below the page header. Here is a [url=http://www.myrocketship.com/blog/blogs/index.php?blog=6]link[/url] if anyone is interested.

In case someone else is interested, here is what worked for me. I placed the Google Adsense code in blogs/skins/evopress/posts.main.php. I placed it directly before these lines:


<div id="content" class="narrowcolumn">

<?php
	// ------------------------- MESSAGES GENERATED FROM ACTIONS -------------------------
	messages( array(
			'block_start' => '<div class="action_messages">',
			'block_end'   => '</div>',
		) );
	// --------------------------------- END OF MESSAGES ---------------------------------
?>

I used a div to shift it a little to line up with the rest of the blog page. Here is the code, with the Google Javascript omitted:


<br>
<div style="padding:10px; padding-left:15px;">

        {Google Javascript goes here}

</div>

[url][/url]


Form is loading...