Hello,
I’m currently using module 10 for loop posts, categories, and tags. and I have set up in the loop.php that ads get display every 3, 6 and 9 posts. Here is the code that I’m using:
if (have_posts()) {
while ( have_posts() ) : the_post();
$adcounter++;
echo $td_template_layout->layout_open_element();
if (class_exists($td_module_class)) {
$td_mod = new $td_module_class($post);
echo $td_mod->render();
if (is_category() or is_tag() or is_home() or is_archive()) {
if ($adcounter ==3) {
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_3"]');
}
}
if (is_category() or is_tag() or is_home() or is_archive()) {
if ($adcounter ==6) {
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_2"]');
}
}
if (is_category() or is_tag() or is_home() or is_archive()) {
if ($adcounter ==9) {
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_2"]');
}
}
} else {
td_util::error(__FILE__, 'Missing module: ' . $td_module_class);
}
echo $td_template_layout->layout_close_element();
$td_template_layout->layout_next();
endwhile; //end loop
echo $td_template_layout->close_all_tags();
} else {
This is working with no problem. My issue is when I create a category template using the cloud library and I add the loop posts, the categories pages don’t show the ads within 3,6 or 9 posts. Is there anything that I need to add on the code above?
Thank you for your time,
Juan
Hi,
Ads in the cloud loop element are not possible at the moment. The cloud library loop element does not use the module you are referring to or share the same theme files. This would require you to modify the plugin files, the modifications will also be lost after an update.
This would be the loop file of the plugin, maybe you can modify this to display ads in it
– https://www.screencast.com/t/yrT3506VGH8
Thanks
