How to put Adsense in the main listing of your Classipress Classifieds sites

Proper ads placement matters most if you want to maximize your earnings (which is specially true with Adsense). One of the best ads placement in Classipress classifieds site is in the main listing where the ads are more conspicuous together with the ads postings. Visitors on your site are more exposed to the ads since they form part in the listings. See sample below;

How to put Adsense in the main listing of your Classipress Classifieds sites

How to put Adsense in the main listing of your Classipress Classifieds sites

And so here’s the code to do just that;

Go to your Dashboard, Appearance then to the Editor . Edit the index.php (Main Index Template) and find this code;

<?php while (have_posts()) : the_post(); ?>

And after that put this code;

<?php if ($count == 3) : ?>

Your Ads Here

<?php endif; $count++; ?>

Just replace “Your Ads Here” with your adsense code. You also have the option to place the ads on the 3rd or 4th listing (and so on) by simply changing $count == 3 to your number of choice.

That’s it for now. Have a great day.

Update: For version 3.1.4 and up check this http://leathermanner.com/how-to-add-adsense-in-the-main-and-category-listings-of-classipress-version-3-1-4.

This entry was posted in Plugins and Mods and tagged . Bookmark the permalink.

8 Responses to How to put Adsense in the main listing of your Classipress Classifieds sites

  1. zulu42 says:

    that’s really cool – so, if i’d like to display two adslots, would i just seperate this by a comma or semicolon and it gets repeated?

  2. admin says:

    I will recheck the codes for that and post it here soon.

  3. Ray says:

    hi could you please tell me how to put adsense in the listing like this website has????

    http://trinifieds.com/classifieds/

    to make it look like a part of the listings

  4. Thanks again for this tips. Got it works :)

  5. admin says:

    You are very welcome and thanks for visiting the site. Have a great day.

  6. Hi,
    I am using the latest version of classipress small business edition and the index.php template is empty.
    Could you tell me where to make the above modifications?
    I already tried the page.php but nothing happens.
    Thank you in advance,

    Alessandro

  7. Ahmed says:

    @Alessandro Gori: I am also using ClassiPress 3, done the little search and found the code in page.php.

    regards

    Ahmed

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>