Hi all, this is my first post on DG, lot of info already gathered thx for that. My question has to do with wordpress 2.1 and the single post. What I want to do is display adsense on each single post view. So not on my homepage, only on the a single post. I have created my own theme and edit the source, but as a intermediate php I guess it has to do with <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry »'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p> </div> <?php endwhile; ?> Code (markup): But how do I check if the loop just displays one single view??? Hope you understand my question Grtz, keitai
I use the wonderful Adsense-Deluxe Wordpress plugin to add Adsense to my individual posts. And I have updated the template that I use to display just one adsense ad between the first and second posts on my blog.
tx mincus, I already use adsense-deluxe (great plugin). But I want to edit the_loop so I can add one adsense on each single post.
Study the structure of a theme (Like Blix) that has a seperate include just for single page. Picking apart other themes is how I've learned everything I know about WP hacking.
ok guys I found the solution if(is_single()){ echo "test google ad"; } Code (markup): Like I said I know a bit or two php, it's just that WP has a lot of custom functions. Put this in the_loop and you see what I mean.