- NewsmagAbove footer ads
- NewsmagSmart list ads
- NewsmagArticle ads
- NewsmagSidebar ads
- NewsmagHeader ads
Hi,
Unfortunately we have not tested taboola ads, but you can try to add your taboola ad code in a custom ad spot inside the theme panel by using this method: https://forum.tagdiv.com/using-other-ads/
Paste the code in a custom ad in Theme Panel > Ads > custom ad – http://screencast.com/t/JFsT6hi5o and use do_shortcode function to place the custom ad
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');?>
You can then place the code in the template files here:
http://screencast.com/t/BHsSOAFTX
Hope this helps!
Hello. How to display custom ad or inline ad in Smart List posts?
Is it possible with child theme?
I followed instruction on this: $buffy .= do_shortcode(‘[td_block_ad_box spot_id="custom_ad_1"]‘);
but have no success.
Hello aabuday,
Please ensure you have followed the correct steps that I gave you above and also, please check again the code to be the same -> <?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]')?> Your update to the latest version of the theme does not influence the functionality of this code.
Hope this helps!
Thank you for the message!
I did the same thing but now it is not working after udpate to latest version earlier that short code was working
<?php echo do_shortcode(‘[td_ad_box spot_id=”custom_ad_1″]’);?>
Hi
The sidebar for archive page can be set from theme panel > template settings: http://screencast.com/t/G6KahfUyq
By default on archive page you can’t use the page-builder from Visual Composer. However you can use do_sortcode function to display blocks on archive page. First you need to get the shortcode from Visual Composer: http://screencast.com/t/vDPzUEldhk – http://screencast.com/t/lqxAJrJcjwn0 then paste it into the indicated function like here: http://screencast.com/t/GgZz9psSiVv
<?php echo do_shortcode('[vc_row][vc_column][td_block_6 category_id="28" limit="6"][/vc_column][/vc_row]');?>
This code will display a block 6 on archive page: http://screencast.com/t/4LDqqUUah This is just a basic example but you can customize it in many different ways.
Let me know how it goes and if this is not what you mean please provide more details.
Thanks!
-
This reply was modified 10 years by
Andrei L..
Hi
Sorry for misunderstanding.
The above solutions works only when a category page it’s displayed. If you want to change the header ad for o post from a specific category then you need to use the in_category() function. Here is a basic example for caribbean and destinations categories on my side: http://screencast.com/t/NDVOIEvs1bg
<?php
if (in_category(array('caribbean','destinations'))){
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');
}
else{
locate_template('parts/header/ads.php', true);
}
?>
This code will load a different header ad for all posts which belong to caribbean and destinations categories.
Note: if you want to change the ad for a post from a specific category the required function is in_category() but if you want to change it for a category page then you have to use is_category().
Hope this help.
Thanks!
-
This reply was modified 10 years by
Andrei L..
Hi
You can use do_shortcode function in loop-single-2.php like here:
<?php echo do_shortcode('block's shortcode'); ?>
To get the shortcode add the block 7 into a blank page then switch in backend editor copy and paste this code: http://screencast.com/t/ij9Sbajz inside do_shortcode function.
Also you will need this code in theme panel > custom code > custom css: http://screencast.com/t/H9G6Yoeocg
.single .td-pb-row .td-pb-row .td-pb-span8{
width: 100%;
}
Hope this help!
Thanks!
-
This reply was modified 10 years by
Andrei L..
Hi
You can use the custom ad-spots to achieve that. The file that must be edited it’s the one which generate the header. That depends by the header style used: http://screencast.com/t/UGqIID8VFO
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]')?>
The result will be like here: http://screencast.com/t/ybG5tpCBjF7 I’ve used custom ad 1 for this example but you can use any custom spot ad, just update the number from shortcode.
Thanks!
-
This reply was modified 10 years by
Andrei L..
Hi
By default the theme does not have options to control the posts displayed in top grid on category page. However this can be achieved by editing the category.php file and ad some if else statements like here: http://screencast.com/t/9zcZxQ2ofSEH
<?php
if (is_category('cat-id1')){
echo do_shortcode('grid's shortcode');
}
elseif (is_category('grid's shortcode')){
echo do_shortcode('grid's shortcode');
}
else {
echo do_shortcode('grid's shortcode');
}
?>
To get the category id follow this link: http://screencast.com/t/lY35tQ0pcR
To get the shortcode for the grid that you want to display create a blank page, add the grid on id and set as you want: http://screencast.com/t/Kynjn2VL copy this code: http://screencast.com/t/2R6NP586 and paste it inside do_shortcode function as I did in this screen: http://screencast.com/t/2R6NP586 – http://screencast.com/t/h6m34UwqD
To avoid having duplicate article on pages enable the Unique article option here: http://screencast.com/t/lfrs0pziRk
Thanks!
-
This reply was modified 10 years by
Andrei L..
Hi
Newsmag theme does not have implemented the ads system for smart list yet that’s why the indicated ad-spots are missing. We plan to implement the ads for smart lists in future theme updates but meanwhile if you want to use them a solution would be to use do_shortcode function in the file corresponding with the smart-list template used: http://screencast.com/t/ys6OJZXx
$buffy .= do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');
In this example I’ve used custom ad 1. If you want to use a different custom ad spot just update the number from shortcode. For example if you use custom ad 4 the shortcode will look like this: custom_ad_4
Let me know how it goes.
Thanks!
Hello,
There are 2 ways of adding ads inside a smartlist. One is the php method where you can use a do_shortcode function and add it inside one of these files: http://screencast.com/t/RAU3ZEudH
Or you can use the visual composer shortcode from an ad box and place the ad directly inside the smartlist content for example this shortcode will grab the ad from the custom ad 1 spot:
[td_block_ad_box spot_id="custom_ad_1" spot_title="Advertisment"]
You just place it in text mode inside the content.
I hope this helps.
Thank you!
Hi,
This will require a bit of customization in order to be positioned properly.
Please add this code in single.php:
<div class="custom-block3"> <?php echo do_shortcode('[vc_row][vc_column width="2/3"][td_block_3 limit="4"][/vc_column][/vc_row]')?></div>
And then use this css to fix the width:
.custom-block3 .td-pb-row .td-pb-span8{
width: 100%!important;
}
Thank you!
Hello mike6209,
For achieving that, you have to use do_shotcode method with custom Ad to add this ad where you want. For example, if you are using post template 2, you have to edit loop-single-2.php file and add this snippet of the code -> <?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]')?> in the desired place, before the featured image like this -> http://screencast.com/t/5hhHr99Iv Also, before check the results, please ensure that you have entered the AdSense code in Custom Ad filed like this -> http://screencast.com/t/OnwclhFX
The result you should see here -> http://screencast.com/t/5adXHIiPCYXl
Thank you for the message!
Hi
1 To display a different header ad for categories pages please check this topic: https://forum.tagdiv.com/topic/different-header-ads-according-to-category/
2 To ad a title for ads you can use this method: https://forum.tagdiv.com/topic/inline-ad-titles/ Note that depending by ad type it may require others customizations.
3 You can use the do_shortcode function in the file which generate each page. For example a page which use pagebuilder + latest as post template require this file to be modified: http://screencast.com/t/Nc8kqxbkFZIs For the category page you can add the code here: http://screencast.com/t/vNFnf6KZ9m3 – http://screencast.com/t/TkfBOExjw The same line of code can be used in tag,php, search.php etc.
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]')?>
Please note that all this customization require custom work and for the moment we can’t offer any custom services. The above solutions contains code which can be adapted such that to obtain the desired result but there are many situations and conditions which must be implemented in order to have all your requests achieved.
If you still need guidance on this or you’re not aware of the steps you need to take in this regard please consider hiring a developer or a freelancer to do this for you.
Thanks!
-
This reply was modified 10 years by
Andrei L..
Hi
To load a different banner for a specific page you can add a condition in the file corresponding with the header style used. For example if you’re using header style 7 the file that must bee edited is header-style-7.php and the code should look like here: http://screencast.com/t/ryRhn07c25
<?php
if (is_page(page-id)){
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');
}
else{
locate_template('parts/header/ads.php', true);
}
?>
Replace the page-id with the numeric id of the page where you want to load a different ad. To get the page id follow this link: http://screencast.com/t/9V7zgx6WK
I used custom ad 1 in this example but you can use any of the custom ads, just update the number from shortcode. Ex: for custom ad 4 the shortcode will be [td_block_ad_box spot_id="custom_ad_4"]
If you want to hide the logo on a specific page just add this condition here: http://screencast.com/t/iT9p861gnJ
<?php
if(!is_page(page-id)){
locate_template('parts/header/logo.php', true);
}
?>
Let me know how it goes.
Thanks!
-
This reply was modified 10 years by
Andrei L..
Hello,
If you want the ad to only appear in one category, then you need to use a condition in the php file. You can use this function:
https://developer.wordpress.org/reference/functions/is_category/ and
Then you can use the code like so:
<?php if (is_category('your category name')){
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');
}
Now the ad will only appear in the specified category.
Thank you!
-
This reply was modified 10 years by
Bogdan B..
Hello dodikmulyanto,
If you want to add the Ads for your top category page, you have to use do_shortcode method with your Custom Ad. The code is -> <?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]'); ?> and this you have to add in your category template core file used by you. For example, below I gave you an example for category template 1 -> http://screencast.com/t/LOwIThu9 Also, please ensure that you have set your Custom Ad 1 -> http://screencast.com/t/hAfyOSQKxt2 In this way, you have to implement on your website.
Hope this helps!
Than kyu for the message!
Hello Kohram,
I have checked your website and I found which is the problem with your smart list pagination. I have checked your page setup and saw that you have selected this option from SEO Yoast Permalinks filed -> http://screencast.com/t/VrG7PsHjHqDc and then the pagination will work fine.
For your second request, if you want to add some additional Ads for your smart list, you have to use do_shortcode method. Please check the screenshot below and follow the steps from there -> http://screencast.com/t/SQTSNs6uc
The code you should find here -> http://pastebin.com/xLNyAw5N
If you want to add the Ads to the mid content, please notice that it is not a simple task and require more additional customizations. As a hint, you have to implement this feature like article inline ads, like this -> http://screencast.com/t/1tuhBI7y Please notice that is not a simple task and if you are not aware the steps in this regard, please consider hiring a freelancer/developer to do this for you because we cannot provide custom services at the moment, sorry!
Hope this helps!
thank you for the message!
Hi
The shortcode that you provided is not correct: http://screencast.com/t/3SXqaSmVXG Please make sure that you added the code like here, clear all caches and test again
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]'); ?>
Thanks!
-
This reply was modified 10 years by
Andrei L..
Hi,
after my last Newsmag theme update, I’ve applied again the code modification you’ve suggested in order to display the 970×90 custom ad under the category post grird (please read the above reported previous thread exchanges. It worked perfectly until the last theme update: now, the same modification doesnt’ work anymore (please see the malfunctioning at http://43b.60a.myftpupload.com/category/sport/calcio/)
What I have to do to display that custom advertising ad_box in the desired space i.e. under the category’s post grid?
Thanks in advance for any help.
Giuseppe Maio
P.S: hereafter the code modification of the file Newsmag/category.php
<div class="td-container">
<div class="td-container-border">
<?php td_api_category_template::_helper_show_category_template() ?>
<?php td_api_category_top_posts_style::_helper_show_category_top_posts_style() ?>
<?php echo do_shortcode('[td_block_ad_box_spot_id="custom_ad_1"]'); ?> // GSM:Display AD BOX 1 under the top post grid
Hello gunner05,
In order to get the post ad above the related articles, you will need to edit the theme files and use a do_shortcode function inside the post template you want the ad to be displayed in. For example, you can use a theme custom ad 1 spot and add this shortcode in each of the loop files corresponding to the post styles you use:
do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]'); ?>
Ad this code to the very top of the loop file like so: http://screencast.com/t/UWFnEMRg
Make sure you have an ad placed in custom ad 1
Hope this helps and let us know how it goes!
Thank you for the message!
Hi,
1) In order to get rid of the margin, you can use a bit of css:
.home .td-a-rec-id-custom_ad_1 > div, .home .td-a-rec-id-custom_ad_2 > div, .home .td-a-rec-id-custom_ad_3 > div, .home .td-a-rec-id-custom_ad_4 > div, .home .td-a-rec-id-custom_ad_5 > div{
margin-bottom:0!important
}
2) In order to limit the width of the ad on the category pages and remove the spacing and title/breadcrumb you can use this code:
.category .g-single{
width: 1068px!important;
}
.category .td-a-rec-id-custom_ad_1 > div{
margin-bottom:0!important;
}
.category .td-crumb-container{
display:none!important;
}
.category .td-category-pulldown-filter{
display:none!important;
}
.category .td-category-header .td-page-title{
display:none;
}
.category .td-category-header{
padding-bottom:0!important;
}
3) In order to get the post ad above the content and the sidebar, you will need to edit the theme files and use a do_shortcode function inside the post template you want the ad to be displayed in. For example you can use a theme custom ad 1 spot and add this shortode in each of the loop files coresponding to the post styles you use:
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]'); ?>
Ad this code to the very top of the loop file like so:
http://screencast.com/t/76hTfIICn6kS
Make sure you have an ad placed in custom ad 1 .
I hope this helps.
Thank you for your message!
Hello,
Unfortunately our theme does not support featured posts. You can however create a featured category and add your posts to it, then add a block in visual composer on the specific post you want it displayed. You can activate visual composer on posts from the plugin settings: http://screencast.com/t/V4d9MhrFxr
if you do not want to do this for every post in particular, you can edit the theme files and edit the specific post template you use and add a function to the file called do_shorctode. This will add a specific block you set to it on every post that uses that particular template you edit. They can be used in the child theme as well.
For example you can create your block in visual composer on a dummy page and get the shortcode for it: http://screencast.com/t/02ccgJ2Q8mN then get the shortcode for the block in classic mode/text mode
Then you can edit the post template from the files: http://screencast.com/t/FBgdVg39o
example: <?php echo do_shortcode('[vc_row][vc_column][td_block_3 category_id="2"][/vc_column][/vc_row]');?>
I hope this helps.
Thank you!
Hello pinnaclecompass,
If you want to move your article top Ad above the featured image for post template style 1, you have to use the do_shortcode method. First of all, please ensure that you have added your Ad code into Custom Ad 1 field like this -> http://screencast.com/t/zr6GWv3hZ and then you have to add this code ->
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]'); ?> in loop-single.php file like this -> http://screencast.com/t/hsXIUf3qA
The result you should see here -> http://screencast.com/t/j5xucHQpEYu4
Hope this helps and let us know how it goes!
Thank you for the message!
Hi Andrei,
1 – A. Thanks for the CSS tip. I made the modifications and the ad is no longer over the buttons
B. Re: The ad widget under the share buttons. The widget code on that page was inserted into the theme panel “Article Bottom Ad” I moved the ad spot to below the share buttons using the instructions giving to me in this post. https://forum.tagdiv.com/topic/pagination-buttons/
4. To display the pagination above the article button add you need to remove the the ad from post content: http://screencast.com/t/PWgzx852 then place the ad after the pagination function in posts’s template file, like this: http://screencast.com/t/pgCbyqSPF You can use the do_shortcode(‘ ‘) function and insert the ad shortcode from VC: http://screencast.com/t/W4SFKPnoShn – http://screencast.com/t/lqaJxdVdMee in every post template files coresponding for the post templetes used.
The article bottom ad is visible on non paginated post and on this paginated post: http://bit.ly/1PB9HQf but no on this one http://bit.ly/1nObbMO. All plugins are disabled.