Osclass forums
Support forums => Themes => Twitter => Topic started by: Akhim on April 20, 2015, 12:25:37 am
-
I found a topic on how to do this started by Keerthi and Contributed immensely by Teseo.
http://forums.osclass.org/tips-and-tricks/(tip)-ads-between-listings/30/ (http://forums.osclass.org/tips-and-tricks/(tip)-ads-between-listings/30/)
But there is nothing on it about twitter theme. Does anyone know how to? Do i edit search.php, search_list.php, or search_gallery.php. which line and codes do i edit? Thank you in Advance
-
:)
-
You're welcome, :) regards.
-
I just want to post Teseo's solution here so a to help other people rather than rummaging through the lengthy topic.
Hi,
Yes, each theme can have a different HTML structure. This should work for Twitter:
search-list.php:
1.- Look for this line:
<?php while ( osc_has_items() ) { ?>
and replace it with:
<?php $adSense_middle_pos = ceil(osc_count_items()/2);
$ad_counter = 0;
while ( osc_has_items() ) { ?>
2.- Replace:
<?php } ?>
<?php } ?>
<div class="pagination">
with:
<?php $ad_counter++;
if ($ad_counter == $adSense_middle_pos) {
//AdSense middle ?>
<div class="line span11 columns">
[Specific AdSense code here]
</div>
<?php }
} ?>
<?php } ?>
<div class="pagination">
Replace "[Specific AdSense code here]" with your actual AdSense code.