Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages »

[SOLVED] Google Adsense


  #1  
Old Jun 26, 2010, 11:47 PM
paragone
 
9 posts · Jun 2010
How can I add Adsense to JUST my TAG Pages and Categories Pages?. I would like to place it above the fold and in the center. Thanks. Love the theme.

John
  #2  
Old Jun 27, 2010, 12:22 AM
paragone
 
9 posts · Jun 2010
Also I would like to add it to the Homepage. I don't want it to show on the posts. I figured it that it needs to go into "The Loop" but it is coming up on my post pages and I don't want that.
  #3  
Old Jun 27, 2010, 10:21 AM
Velma
 
272 posts · Feb 2009
Hmmm...my immediate thought is to create a new widget area there, but I'm not sure how to restrict it to certain pages like can be done with the left and right sidebars in the "Style and Configure Sidebars" area.

Velma
  #4  
Old Jun 27, 2010, 07:31 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Put it in the'Above the loop' area and wrap it in a php if statement. You can use the is_category() and is_tag() functions in the 'if'
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Jun 27, 2010, 07:54 PM
paragone
 
9 posts · Jun 2010
Hey juggledad! I am a complete noob. I know nothing about PHP. How would that look?
  #6  
Old Jun 28, 2010, 11:28 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
try this
HTML Code:
<?php if (is_category() or is_tag()) { adsense code here } ?>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #7  
Old Jun 28, 2010, 02:28 PM
paragone
 
9 posts · Jun 2010
Is this how it is suppose to look??

<?php if (is_category() or is_tag()) { <script type="text/javascript"><!--
google_ad_client = "pub-4544333633484176";
/* 728x90, created 6/20/10 */
google_ad_slot = "8303439851";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>} ?>

I keep getting this error: Parse error: syntax error, unexpected '<' in /home/paragone/public_html/wp-content/themes/atahualpa351/functions.php(532) : eval()'d code on line 7

I also would like to apply this code to my HOMEPAGE. So would I throw a "IF" statement in for that also? Thanks a million

John
  #8  
Old Jun 28, 2010, 03:19 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
8you can't mix php and html without being very careful. put all the html in an echo 'code goes here';
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #9  
Old Jun 28, 2010, 05:35 PM
paragone
 
9 posts · Jun 2010
I am lost "Echo"?? I googled it. Still at a lost. It's not coming up on my "Homepage" either. How is it exactly suppose to look?? The whole code. I would be willing to make a donation, if I can just send you my email and password. I will be here till hell freezes over when I figure it out.
  #10  
Old Jun 29, 2010, 05:22 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
try this, it should display th ad on a category page, a tab pag and the home page but only the first of the home pages.

HTML Code:
<?php if (is_category() or is_tag() or (is_front_page() and (!is_paged())) { echo '<script type="text/javascript"><!--
google_ad_client = "pub-4544333633484176";
/* 728x90, created 6/20/10 */
google_ad_slot = "8303439851";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>'; } ?>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #11  
Old Jun 30, 2010, 12:08 AM
paragone
 
9 posts · Jun 2010
It keeps giving me this error. I am taking the EXACT code. Copy and Paste and it is still giving me a problem.And it is still showing on where I post my individual articles (On their own page) which I dont want ....

This is my site: http://paragonesystems.com/

This is where I DO NOT want the ads to come up. On individual posts like these: http://paragonesystems.com/top-flori...ctions-part-2/


Parse error: syntax error, unexpected '{' in /home/paragone/public_html/wp-content/themes/atahualpa351/functions.php(532) : eval()'d code on line 7

Thanks again for taking the time and really caring about helping me out. I really appreciate it. Thanks a million.

John
  #12  
Old Jun 30, 2010, 05:20 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
oops, one extra open paren change '(!is_paged()))' to '!is_paged()))'
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #13  
Old Jun 30, 2010, 11:47 PM
paragone
 
9 posts · Jun 2010
OOOOO YEEEAHHHHHH... Great job!! It finally worked. Thanks for the amazing support!!! Thanks for going above and beyond. Keep up the amaaaaazzziinnnggggg work!!!

John

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Google Adsense and Atahualpa loybanks Sidebars & Widgets 2 Mar 30, 2010 08:07 AM
Google Adsense outrightent Atahualpa 3 Wordpress theme 2 Sep 14, 2009 12:10 AM
Google adsense in Atahualpa martingale Atahualpa 3 Wordpress theme 3 Sep 6, 2009 11:58 AM
Hi, I want to put a google ad in the header. google adsense vishvadeep Header configuration & styling 5 Aug 27, 2009 12:30 PM
Insert Google Adsense Section Targetting RibaRiva Forum How-To 0 May 19, 2009 11:13 AM


All times are GMT -6. The time now is 10:46 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.