Community Forums › Forums › Archived Forums › Design Tips and Tricks › Hello! I have a ? about stopping something from showing on category pages.
- This topic has 4 replies, 2 voices, and was last updated 11 years ago by
LionArcherWeb.
-
AuthorPosts
-
January 22, 2015 at 12:31 pm #138283
LionArcherWeb
MemberThere are tons of ?s in the forum, I tried to locate my issue but I guess its harder because of the different terms/jargon we all used. Thanks in advance for helping me out.
I wanted to embed my adsense into my posts, I finally learned to so this with the help of edit css and simple hooks plugin. I'm happy about this because it provides me with the best ctr (they are temporarily off my website as I try to figure this out).
I run into issues when viewing my category pages. The ads show up on every excerpt and I want this to not happen. It makes a blank space where the ad should be and makes the layout look awkward.
Can I prevent this from happening? I tried to use a code like <if single?> (not exactly it but I'm sure you guys would know what I mean) but it didn't prevent the ads from showing in category pages.
I was thinking of creating a single.php custom file for my news pro child theme but I'm not sure about that or editing the genesis single.php.
Any tips or suggestions to point me in the right direction?
So I added a little bit of content for you :HELLO STUDIOPRESS MY AD IS USUALLY HERE
And also here is my category page: http://thetaoism.com/category/uncategorized/
http://thetaoism.comJanuary 22, 2015 at 2:09 pm #138288Ren Ventura
MemberIf you want the adsense code to appear ONLY on single posts, use a conditional like this:
if ( is_singular( 'post' ) ) { ?> Adsense code here <?php }If you need further help, post the code you're using so someone can take a look.
Web & Software Developer & Blogger | RenVentura.com | Follow Me on Twitter @CLE_Ren
January 22, 2015 at 8:11 pm #138359LionArcherWeb
MemberThis code did not work for me. Can you explain specifically where you would want me to post it? Was I to post it into my genesis single.php? It is the only method I did not try. Would you really like for me to post my code? I actually am not doing anything but using the simple hooks plugin. If you are talking about the small edit I made to the .css then it is as follows:
.Adsensepost {
float: right;
padding-left: 15px;
}and then within the genesis_entry_header Hook:
<div class="Adsensepost">my ad code</div>
I don't know what I'm missing...
January 22, 2015 at 8:52 pm #138362Ren Ventura
MemberSince you're using the Simple Hooks plugin, you'll need to start/end the code with PHP tags and select the check box to execute PHP.
<?php if ( is_singular( 'post' ) ) { ?> Adsense code here <?php } ?>
Web & Software Developer & Blogger | RenVentura.com | Follow Me on Twitter @CLE_Ren
January 23, 2015 at 7:55 pm #138475LionArcherWeb
MemberThanks so much! It's almost exactly like the first code I tried to write, but I was missing some important elements... (like 'post' lol) Thanks so much it helped me understand my mistakes.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.