Hi, I have a WP blog and was wondering how to add an Adsense unit in header BUT only on some posts. In fact, this is the main question: how to make Adsense ads appear only in some posts' header? Cheers!
He need the ads, only on some posts and not all the posts. If you edit in header.php you will get the ads on all pages.
You may try 'adsense on top' and 'adsense optimizer' combination to place ads on header, but it shows ads on all pages.
Simply, Edit Header.php template file within your template directory and paste Adsense code at right location.
You need to add the code in your header file. Use wordpress conditional tags to display it only on certain pages. <?php if (!( is_home() )) { ?> <?php include('adfile.php'); ?> <?php } ?> Code (markup): create a PHP file and place your ad code in the file and call the file with the above code. Edit it to what ever pages you want the ad to show on. You can find conditional tags here -- http://codex.wordpress.org/Conditional_Tags
editing the Header code is enough dude. but you can definitely find some plugin for this too. cause WP has Plugins for every thing thanks
This will depend a lot on the kind of theme that you are using, there are quite a lot of themes which have adsense in the header, but then you need it only on certain posts, so that makes it more tricky, may be you need to contact a developer.
No he don't I just told him how above. --- Wow, all you people never heard of conditional tags? and you call yourself webmasters... This is very easy to accomplish, I can't believe all these people saying he needs a coder and are acting like this is hard to do. it's very easy to do. -- OP, follow the instructions I posted above and PM me if you need any help.