TutZone- Tutorials, Design news and Inspiration | ![]() |
Display Ads in WordPress Only After First Post Posted: 14 Sep 2010 04:49 AM PDT If you ever tried to insert a piece of code or advertisement code in WordPress loop, you must have realized it would have shown after every post. With this simple hack you can show your ad code, whether it be Google Adsense or any other code, to show only after first post. Procedure:Note: Do take backup of your theme before you try this. 01. In your WordPress Admin panel go to Appearance => Editor. 02. Then choose header.php file from right hand side and add search for this code: <?php endwhile; ?> And add below code (replaced with your ad code) immediately before above code: <?php if(!$show_ads){ ?> 03. Replace Insert Code Here with your ad code. This concludes this simple and useful tutorial. Hope you like it. |
You are subscribed to email updates from TutZone To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
No comments:
Post a Comment