[SOLVED] Google Adsense
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 |
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.
|
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 |
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'
|
Hey juggledad! I am a complete noob. I know nothing about PHP. How would that look?
|
try this
HTML Code:
<?php if (is_category() or is_tag()) { adsense code here } ?> |
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 |
8you can't mix php and html without being very careful. put all the html in an echo 'code goes here';
|
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.
|
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"><!-- |
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 |
oops, one extra open paren change '(!is_paged()))' to '!is_paged()))'
|
OOOOO YEEEAHHHHHH... Great job!! It finally worked. Thanks for the amazing support!!! :):):) Thanks for going above and beyond. Keep up the amaaaaazzziinnnggggg work!!!
John |
All times are GMT -6. The time now is 02:20 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.