Hi Bettina,
The issue is none of the ad plugins for WordPress can insert ads in pages generated by auto scroll. Even when we use theme panel ads option or using ad block via cloud template the ads don’t appear in the auto scroll posts.
We want to show ads in content after every 3 paragraphs. We are currently using advanced ads plugin for this. The plugin works for all posts except the ones generated by auto scroll.
Please see below what the plugin author has to say about the auto scroll issue.
Developers of AJAX-loading plugins or themes should make sure that is_singular() and in_the_loop() return true in their content. You could add something like this to your loop:
global $wp_query;
$wp_query->is_single = true;
$wp_query->is_singular = true;
$wp_query->in_the_loop = true;
Can you tell me how to do this? This will benefit everyone using newspaper theme as currently ads cannot be displayed in auto scroll posts.
-
This reply was modified 4 years by
tangy.
Hi Bettina,
I am not using Adsense ads. I am using ads from other ad network. Where can I place their codes to make the ads appear in the auto scroll pages? Thanks in advance.
Also, when I try to save changes using cloud template I receive the following error”Invalid data Current state has involved an issue. You could try an UNDO operation (CTRL+Z / CTRL+SHIFT+Z)”
I deleted the cache and disabled all caching but the problem still persists. I also completely changed the theme design but when I log out still see the same theme.
Oh ok. Thanks.
Thanks Simon!
Perfect! Thanks Colin.
I want the button color to be #4db2ec and when the mouse hove on buttons it should turn black. Can you give me the codes for the same? Thanks.
https://www.techshout.com/features/2017/14/iphone-8-everything-we-know-so-far/2/ I don’t want the title “Apple iPhone 8: Everything We Know So Far” to show from the second page onward.
Thanks that works! Can you tell me in which line do I have to insert this code if I want the ad to appear before the first image and after?
It doesn’t seem to work for me.
I am trying to load custom ad 2 starting from the second page. Here is the code I am tried using…
if ($current_page > 1) {
$buffy .= td_global_blocks::get_instance(‘td_block_ad_box’)->render(array(‘spot_id’ => ‘custom_ad_2’));
}
Here is my smart list 6 page code…
<?php
class td_smart_list_6 extends td_smart_list {
protected $use_pagination = true; // set this to true to use rela pagination on this template
protected function render_before_list_wrap() {
if(td_global::$cur_single_template_sidebar_pos == ‘no_sidebar’) {
$td_class_nr_of_columns = ‘ td-3-columns ‘;
} else {
$td_class_nr_of_columns = ‘ td-2-columns ‘;
}
$buffy = ”;
//wrapper with id for smart list wrapper type 2
$buffy .= ‘<div class=”td_smart_list_6’ . $td_class_nr_of_columns . ‘”>’;
return $buffy;
}
protected function render_list_item($item_array, $current_item_id, $current_item_number, $total_items_number) {
//print_r($item_array);
$buffy = ”;
//creating each slide
$buffy .= ‘<div class=”td-item”>’;
$buffy .= ‘<div class=”td-number-and-title”><h2><span class=”td-sml-current-item-nr”>’ . $current_item_number. ‘</span><span class=”td-sml-current-item-title”>’ . $item_array[‘title’] . ‘</span></h2></div>’;
$buffy .= ‘<div style=”text-align: center; font-size: 10px; margin-bottom: 5px;”><span style=”color: #666666;”>ADVERTISEMENT</span> </div> <div style=”border-top: 1px solid #e9e9e9;text-align: center; margin-bottom: 12px;”></div><!– Ezoic – TS-SL-728×90 – under_page_title –>
<div id=”ezoic-pub-ad-placeholder-105″>’;
$buffy .= ‘<div class=”adsense”>’;
$buffy .= td_global_blocks::get_instance(‘td_block_ad_box’)->render(array(‘spot_id’ => ‘custom_ad_4’));
$buffy .= “</div></div>”;
//$buffy .= ‘<div style=”border-top: 1px solid #4DB2EC;text-align: center;color: #56565A; margin-bottom: 8px;”></div></div>’;
//get image info
$first_img_all_info = td_util::attachment_get_full_info($item_array[‘first_img_id’]);
//get image link target
$first_img_link_target = $item_array[‘first_img_link_target’];
//image caption
$first_img_caption = $item_array[‘first_img_caption’];
//image type and width – used to retrieve retina image
$image_type = ‘td_696x0’;
$image_width = ‘696’;
if(td_global::$cur_single_template_sidebar_pos == ‘no_sidebar’) {
$first_img_info = wp_get_attachment_image_src($item_array[‘first_img_id’], ‘td_1068x0’);
//change image type and width – used to retrieve retina image
$image_type = ‘td_1068x0’;
$image_width = ‘1068’;
} else {
$first_img_info = wp_get_attachment_image_src($item_array[‘first_img_id’], ‘td_696x0’);
}
if (!empty($first_img_info[0])) {
//retina image
$srcset_sizes = td_util::get_srcset_sizes($item_array[‘first_img_id’], $image_type, $image_width, $first_img_info[0]);
// class used by magnific popup
$smart_list_lightbox = ” td-lightbox-enabled”;
// if a custom link is set use it
if (!empty($item_array[‘first_img_link’]) && $first_img_all_info[‘src’] != $item_array[‘first_img_link’]) {
$first_img_all_info[‘src’] = $item_array[‘first_img_link’];
// remove the magnific popup class for custom links
$smart_list_lightbox = “”;
}
$buffy .= ‘
<figure class=”td-slide-smart-list-figure td-slide-smart-list-6’ . $smart_list_lightbox . ‘”>
</figure>
<figcaption class=”td-sml-caption”><div>’ . $first_img_caption . ‘</div></figcaption>
‘;
}
$tds_smart_list_6_title = td_util::get_option(‘tds_smart_list_6_title’);
// ad smart list 6
//$buffy .= ‘<div style=”text-align: center; font-size: 12px; margin-bottom: 6px;”><span style=”color: #666666;”>ADVERTISEMENT</span> </div> <div style=”border-top: 1px solid #4DB2EC;text-align: center;color: #56565A; margin-bottom: 12px;”></div> <!– Ezoic – TS-SL-728×90-2 – under_first_paragraph –>’;
$buffy .= ‘<div class=”adsense”><div id=”ezoic-pub-ad-placeholder-106″>’;
$buffy .= td_global_blocks::get_instance(‘td_block_ad_box’)->render(array(‘spot_id’ => ‘smart_list_6’, ‘spot_title’ => $tds_smart_list_6_title));
//$buffy .= ‘<div style=”border-top: 1px solid #4DB2EC;text-align: center;color: #56565A; margin-bottom: 8px;”></div>’;
$buffy .= “</div></div></div><!– End Ezoic – TS-SL-728×90-2 – under_first_paragraph –>”;
$buffy .= “<!– google_ad_section_start –>”;
//adding description
if(!empty($item_array[‘description’])) {
$buffy .= ‘<span class=”td-sml-description”>’ . $item_array[‘description’] . ‘</span>’;
}
$buffy .= ‘</div>’;
// render the pagination
$buffy .= “<!– google_ad_section_end –>”;
$buffy .= ”;
$buffy .= ‘<div id=”ads” style=”clear:both;padding-top:15px;”><div style=”float:left;”>’;
$buffy .= ‘<!– Ezoic – TS-SL-336×280 – bottom_of_page –>
<div id=”ezoic-pub-ad-placeholder-107″><div class=”adsense”>’;
$buffy .= td_global_blocks::get_instance(‘td_block_ad_box’)->render(array(‘spot_id’ => ‘custom_ad_5’));
$buffy .= ‘</div></div></div>
<!– End Ezoic – TS-SL-336×280 – bottom_of_page –>’;
$buffy .= ‘<!– Ezoic – TS-SL-336×280-2 – bottom_of_page –>
<div id=”ezoic-pub-ad-placeholder-108″><div class=”adsense”>’;
$buffy .= td_global_blocks::get_instance(‘td_block_ad_box’)->render(array(‘spot_id’ => ‘custom_ad_3’));
$buffy .= “</div></div>
<!– End Ezoic – TS-SL-336×280-2 – bottom_of_page –>”;
$buffy .= ‘<div id=”ezoic-pub-ad-placeholder-117″>’;
$buffy .= td_global_blocks::get_instance(‘td_block_ad_box’)->render(array(‘spot_id’ => ‘custom_ad_1’));
$buffy .= ‘</div>’;
// render the pagination
$buffy .= $this->callback_render_pagination();
//$buffy .= $this->callback_render_drop_down_pagination();
$buffy .= ‘<div style=”text-align: center; font-size: 12px; margin-bottom: 2px;”></div><!– Ezoic – TS SL Native Bottom – native_bottom –>
<div id=”ezoic-pub-ad-placeholder-194″>’;
$buffy .= td_global_blocks::get_instance(‘td_block_ad_box’)->render(array(‘spot_id’ => ‘custom_ad_2’));
$buffy .= “</div><!– End Ezoic – TS SL Native Bottom – native_bottom –>”;
return $buffy;
}
protected function render_after_list_wrap() {
$buffy = ”;
$buffy .= ‘</div>’; // /.td_smart_list_6 wrapper with id
return $buffy;
}
}
I need to show a certain ad beneath the next and previous buttons starting from the second page onward. Is the below code correct? It doesn’t seem to work.
if ($current_page > 1) {
$buffy .= ‘<div style=”text-align: center; font-size: 12px; margin-bottom: 6px;”><span style=”color: #666666;”>ADVERTISEMENT</span> </div>’;}
-
This reply was modified 8 years by
tangy.
Yes, I am placing them in the smart list file. But none of the code above seem to work. They show the content on all the pages instead of starting from the second page. Please help!
Thanks that works! How come there is no such option through theme panel?
I am using block 3 and I want to change the font of the links in block 3.
https://www.techshout.com/software/2018/09/whatsapp-warn-suspicious-links/ How can I change the font of the circled link?
That works! Thank you!
Hi,
I tried the code but it didn’t change anything. Also, it shows an error in the custom CSS panel for the use of exclamation mark. Please advice.
Got the solution 🙂
Please do not use this option of the seo yoast plugin: https://www.screencast.com/t/n8Cc35EofLh If you do not use seo yoast, please disable all plugins except the tagdiv composer, clear cache and reset cdn files. Then test the composer again.
I am facing the same issue. Somebody please help.
I have also made all the changes mentioned here https://forum.tagdiv.com/system-status-parameters-guide/ and still nothing.
I am already using the header ad. I want to insert an additional 728 x 90 ad beneath the menu buttons, this ad should only be visible on the homepage and not in the internal pages. So I need to know the file which I have to edit to insert the ad code. Here is the site http://www.techshout.com/