How To Put Adsense Ads Within Your WordPress Post Contents



How to Add Ads Between Posts:

1. Log into your WordPress admin panel

2. Select Presentation -> Theme Editor from the navigation menu

3. From the Theme Editor, find and select the "Main index template" (index.php) from the list to the right

4. Find the following line
<?php if (have_posts()) : ?>

5. Above it add the following line
<?php $count = 1; ?>

6. Now find the following line
<div>

7. Add the following code directly below it (replace AdSense Code with your code)
<?php if ($count == 1) : ?>
AdSense Code
<?php endif; $count++; ?>

8. Click update file, then go view your site to confirm that the ad has been added to the first post listing.Note: To change which post your ad is placed under, simply change the count numberExample: $count == 2 will place the ad under post 2

masood

Phasellus facilisis convallis metus, ut imperdiet augue auctor nec. Duis at velit id augue lobortis porta. Sed varius, enim accumsan aliquam tincidunt, tortor urna vulputate quam, eget finibus urna est in augue.

No comments:

Post a Comment