Hello,
Any help would be greatly appreciated.
I am trying to insert a custom ad into the loop-single-1.php
i followed instructions here: https://forum.tagdiv.com/how-to-insert-ads-in-custom-areas-of-the-website/
custom ad 8 in the theme options is populated with this ad code:
<div id=”taboola-below-article-thumbnails”></div>
<script type=”text/javascript”>
window._taboola = window._taboola || [];
_taboola.push({
mode: ‘thumbnails-j’,
container: ‘taboola-below-article-thumbnails’,
placement: ‘Below Article Thumbnails’,
target_type: ‘mix’
});
</script>
I created a new page with just the ad block (in this case custom ad 8). Then i saved the page and grabbed the shortcode:
<?php echo do_shortcode(‘[vc_row][vc_column width="1/1"][td_block_ad_box spot_id="custom_ad_8" spot_title="Taboola Under"][/vc_column][/vc_row]‘);?>
I placed the code below related posts into the loop-single-1.php like this:
<footer>
<?php echo $td_mod_single->get_post_pagination();?>
<?php echo $td_mod_single->get_review();?><div class=”td-post-source-tags td-pb-padding-side”>
<?php echo $td_mod_single->get_source_and_via();?>
<?php echo $td_mod_single->get_the_tags();?>
</div><?php echo $td_mod_single->get_social_sharing_bottom();?>
<?php echo $td_mod_single->get_next_prev_posts();?>
<?php echo $td_mod_single->get_author_box();?>
<?php echo $td_mod_single->get_item_scope_meta();?>
</footer></article> <!– /.post –>
<?php echo $td_mod_single->related_posts();?>
<?php echo do_shortcode(‘[vc_row][vc_column width="1/1"][td_block_ad_box spot_id="custom_ad_8" spot_title="Taboola Under"][/vc_column][/vc_row]‘);?>
<?php
} else {
//no posts
echo td_page_generator::no_posts();
}
however the final display is like this: https://www.dropbox.com/s/b5fke5p32qyz2n0/under%20related%20posts.PNG?dl=0
I need it nicely fit like it does when the same ad code is placed in the Article Bottom Ad < which i dont use because I need placed below related articles instead of above. exactly like here: https://www.dropbox.com/s/tifoolvtsyoayk4/article%20bottom%20ad.PNG?dl=0
Any assistance would be greatly appreciated.
Thank you
you can see example of the issue/website here: http://dev.diaryofahollywoodstreetking.com/weezy-says-fck-cash-money/
login: client
pass: client
thanks,
Hi,
You use a shortcode with full width row – http://screencast.com/t/npAuhitKEYjW
Please try to paste the code like this and see if it solve the issue:
<?php echo do_shortcode ('[td_block_ad_box spot_id="custom_ad_8"]'); ?>
Thanks!
-
This reply was modified 11 years by
Alin [tagDiv].
Thanks Alin.. I changed the shortcode and now the full code input for the ad looks like this:
<div class=”td-container”>
<div class=”td-container-border”>
<div class=”td-pb-row”>
<?php echo do_shortcode(‘[td_block_ad_box spot_id="custom_ad_8"]‘);?>
</div>
</div>
</div>
but still displays like this: https://www.dropbox.com/s/zcmpbujswd6vbiq/shortcode%20ad.PNG?dl=0
page used for screenshot (third 2 row advert in center column): http://dev.diaryofahollywoodstreetking.com/kenya-moore-millionaire-matchmaker-sponsor/
login: client
pass: client
Hi,
I’m not sure is this is how you want to display it – http://screencast.com/t/90row1eKP
Please try this custom css in Theme Panel > Custom Css if this is what you want:
.td-a-rec-id-custom_ad_8 .ac_adbox {
text-align: center !important;
}
Thanks!
yes this worked perfectly thank you!
but, the same style does not work for the other one seen here, is it possible you shoot me the style for that one too?
Thanks again!
https://www.dropbox.com/s/6gg2o5anwn96g4z/second%20row%20center.PNG?dl=0
login: client
pass: client
Hi Alin,
Your styling fixed the center issue.. But it seems to have created another issue.
Now when viewing on tablet it causes the sidebar to not display proper as seen here: https://www.dropbox.com/s/9k1y17aw15tg2p8/IMG_0275.PNG?dl=0
Please advise. Thank you.
Hi,
Try to replace that css code with this one to add only margin: http://screencast.com/t/rIx1FeRQJF
.td-a-rec-id-custom_ad_7 .ac_container {
margin-left: 2%;
}
Thanks!
Alin, thanks, but its still breaking the sidebar.
See here: https://www.dropbox.com/s/rb67cnr8ycpgzat/breaking%20sidebar.PNG?dl=0
any other suggestions?
Alin, I fixed it by deleting these divs:
<div class=”td-container”>
<div class=”td-container-border”>
Thanks for the attention on this.. All sorted now!