- NewsmagAbove footer ads
- NewsmagSmart list ads
- NewsmagArticle ads
- NewsmagSidebar ads
- NewsmagHeader ads
- NewspaperHeader ads
- NewspaperSidebar ads
- NewspaperArticle Ad
- NewspaperPost template ads
- NewspaperAbove footer ads
Hello EDMSU,
Unfortunately, I do not understand very good what you want to achieve but I assume that you want to add some blocks to your category page. Please notice that our theme does not have such a simple option to customize the category page from the panel but you can do that only through code. In order to achieve this, you have to use the do_shortcode method and is_category() condition to implement this. For more reference about this condition, please check the codex, here -> https://developer.wordpress.org/reference/functions/is_category/ You need to know your category ID, you can get it in this way -> http://screencast.com/t/gsigPgFEVZJs
Before using the do_shortcode method, you have to create the shortcode for the specific item you want to display on your category page. For example, if you want to add the Popular Categories you have to follow the next steps -> http://screencast.com/t/Q7dzh54VILK -> http://screencast.com/t/cnpkgXvIGH and then you have to place this in do_shortcode syntax, like this -> <?php echo do_shortcode('[td_block_popular_categories]');?> After you have created this code you have to place it in category.php like this -> http://screencast.com/t/i2696YG6
Please notice that is not a simple task and if you are not aware of the steps in this regard, please consider hiring a freelancer/developer to help you because we cannot provide customization services at the moment, sorry!
Thank you for your understanding!
Hello willysawa,
If you want to place your Ad under your related Articles feature for each post, you have to introduce the following code <?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');?> in loop file, specific for each post template you are using. For example, if you are using the post template style 1 you have to edit the loop-single-1.php and lace the code under the related articles, like this -> http://screencast.com/t/TWF8DXexGpeg
Thanks.
Hello okgo87,
Please provide more details and show me the exact area where you want to add your personal banner. In order to achieve that, you have to use the do_shortcode method for thins implementation. Please provide some useful screenshots so I can understand better what you want to achieve and so I will be able to provide a more accurate code.
Thanks.
Hi
I am not sure where exactly you want to add custom ads in header. Basically this can be done using do_shortcode function. For more details please check this topics: https://forum.tagdiv.com/topic/different-header-ads-according-to-category/ – https://forum.tagdiv.com/topic/sub-page-no-standard-top/
Thanks!
Hi Rachel,
You can add a block to the post files using a do_shortcode function like so:
<?php echo do_shortcode('[vc_row][vc_column][td_block_12][/vc_column][/vc_row]'); ?>
You can add this code to the post template you use:
http://screencast.com/t/pXGvKb7aZ
The tricky part will be to make them detect the category of the post. The blocks were not created to detect anything so this feature will have to be created from scratch. You will need to hire a developer for it as there is no easy solution.
Thank you!
Hello willysawa,
If you want to add the ad code to appear for each post under the related articles, you have to alter the file where this function are created and also you should use the do_shoretcode method to implement the advertisements as you wish. You have to do changes in td_module_single_base.php file and you have to introduce the following code in the specific place, like this -> http://screencast.com/t/LcyIuQ87
The code is -> $buffy .= do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');
Before you check your results, please ensure that you have added the code into custom ad 1 field from your theme panel.
Hope this helps and let us know how it goes!
Thank you for the message!
Hello willysawa,
If you want to add this feature for your side above your menu, you have to use the do_shortcode method in order to achieve as you wish. You have to add the following snippet of the code in header-menu.php file, like this ->
http://screencast.com/t/8XbhMLA0rfZ and the code is -> do_shortcode('[td_block_trending_now]');?>
The result you should see here -> http://screencast.com/t/HfWKKiEnOF
Thank you for the message!
Hello willysawa,
If you want to use the same method that I gave you above for displaying your ads, you have to use the generated code by your plugin in order to achieve best results and place it in the do_shortcode between braces (‘ your shortcode ‘). Please notice that we cannot provide customization services for untested plugins. If you want to display more levels and you are not aware of the steps in this regard, please consider hiring a freelancer/developer to help you because we cannot provide custom work at the moment, sorry!
Hope this helps!
Thank you for the message!
Hi
You can use is_page() wp function to display the banner on a page with a specific id. The code will look like this:
<?php
if (is_page(page_id)) {
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');
}
?>
Just replace the page_id with the numerical id of the page where you want to display the ad. To get the id follow this link: http://screencast.com/t/0sAaySfVL7
Thanks!
-
This reply was modified 10 years by
Andrei L..
Hello nomadhermit,
If you want to add the widget to the bottom of individual posts, you have to use the Widgetised Sidebar and place it with do_shortcode method where you want in the posts. First of all, you have to create the code with the desired widget from your Visual Composer editor, like this -> http://screencast.com/t/maoAeYKaIFo -> http://screencast.com/t/pXvfBOVQgU (example for td_demo_category_widget) and then, this snippet of the code <?php echo do_shortcode('[vc_widget_sidebar sidebar_id="td-td_demo_category"]'); ?> you have to place in the post template used by you in the bottom of the page, like this -> http://screencast.com/t/kXiU748n (this is just an example for post template 1). Also, please notice that you can set your widgets from Widgets area section, like this -> http://screencast.com/t/LoSeuujRP0
Hope this helps!
Thanks.
Hi
6,7. Please provide your site url so I can inspect this closer and get back to you with a more accurate answer.
9. You can use one of theme’s ad-spots to display the ad on top of the page. First insert the html ad’s code in one of custom ad-spots from theme panel > ads then use do_shortcode() function to display a banner ad on top of the page. Just edit the file corresponding with the header style used and add this code like here: http://screencast.com/t/itasx4W4T – http://screencast.com/t/FSgnXBREg3
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]'); ?>
I’ve used custom ad 1 for this example but you can use any custom ad, just adapt the shortcode. For example if you use custom ad 5 the shortcode will be: td_block_ad_box spot_id=”custom_ad_5″
To insert the banner ad below big grid you can use the ad-box block from visual composer like here: http://screencast.com/t/trJzEe9Ufr – http://screencast.com/t/veASTnq2d
Thanks!
Hi,
@Breakwater
Unfortunately there are no settings for the attachment page other than the ones seen here: http://screencast.com/t/x4ieLRMn74s You cannot add visual composer elements to the attachment page from the theme panel. What you can do is use the do_shortcode function to add content through code. Every visual composer element has a shortcode that can be seen here: http://screencast.com/t/lEQjrxFAZo
Then you can use this code:
do_shortcode('ADD YOUR SHORTCODE HERE'); ?>
You can add the code in the attachment template file like so: http://screencast.com/t/yht7usHz
Now my block appeared on the attachment page: http://screencast.com/t/GQ0WNwFcjif
@dizajn
I’m not sure why you get the attachment page from linking to the media file. This should be the result in linking to the media file: http://screencast.com/t/1Kgp9otgj
If this is the case and your images realy link to the attachment page instead of the media file, please try to disable all plugins except visual composer, clear cache and reset vdn files. There could be a plugin conflict that does this.
Thank you!
Hi,
You can add your adsense code in the custom ad 1 spot in the theme panel and then use this code:
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]'); ?>
and add it here: http://screencast.com/t/3Gu4HDHLw4D
Thanks.
Wow, That is a whole lot of questions in one!
1) Unfortunately the latest articles cannot stretch to the whole width as they are not visual composer elements. There is no easy way to do it.
2) You cannot get the footer ad outside the footer. You will need to place the add in every post template, category template or page as the footer ad is meant to stay in the footer. It cannot create the necessary space for it in every other template that displays above it. If you want this custopmization you have a bit of work to do as you need to use this code:
do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]'); ?>
Then place an ad in the custom ad 1 spot and then use it in every post template you use: http://screencast.com/t/pxohXgHczwym (these are in the root directory), the category pages: http://screencast.com/t/zgs5t556 , search results, and any other content you have on your site.
As you can see it’s not that easy.
3)You cannot add borders to the big grid as borders will increase the width with a few pixels and the grid depends on it’s fixed width. The layout will break if I add borders with css to it.
4)Please follow this topic to see how this issue can be resolved: https://forum.tagdiv.com/topic/chinese-social-icons/
5) a)It’s best to hide the section altogether and simply upload a mobile logo from the theme panel as there is no point in having 2 logos :
@media (max-width:767px){
.td-header-sp-recs{
display:none!important;
}
}
b) same issue as answer 4
Thanks.
Hi,
the best way to insert ads through the php files is the do_shortcode function: https://developer.wordpress.org/reference/functions/do_shortcode/
This nifty function will render all visual composer shortcodes including an ad box. So the best way to do it is create a dummy ad box on a page and set it up the way you like (you must make use of the ad spots in the theme panel) and then simply enter classic mode and text m,ode to get the shortcode for the element.
Then you can use the function like so:
do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]'); ?>
Mind the php tags as some places already have them open so you do not need them there.
FOr your specific case with the search results, you can add the code like so: http://screencast.com/t/jSjEOEbrtu
Hope this helps.
Thank you!
Hello heisenberg234,
Yes, it is okay in your case. Above, I gave you an example with do_shortcode because this kind of method offers you the way to add the ads anywhere on the site and you can use it when you do not have an option from Theme panel.
If you need only 2 columns in your post content, you can set it from editor, like this -> http://screencast.com/t/bhNecroT and if you need more than 2 columns, you have to create the code from Visual Composer editor and then you have to copy/paste the code in the HTML source of the post, like this -> http://screencast.com/t/UJfUJPnz -> http://screencast.com/t/rnuVk21z6oQj -> http://screencast.com/t/hlK5SRP4SoA
and the result you should see here -> http://screencast.com/t/bo0oqWUQcb
Hope this helps!
Thank you for the message!
Hi
That happens because in your code is missing a bracket. Replace that code with this one, it should work fine:
<div class="td-header-rec-wrap">
<?php
// show the header ad spot
if (in_category('Automotive')) {
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_4"]');
}
else {
locate_template('parts/header/ads.php', true);
}
?>
</div>
Thanks!
-
This reply was modified 10 years by
Andrei L..
Hello heisenberg234,
If you want to insert the ad under the main menu bar, you have to use the do_shortcode method. Please follow the below tutorial ->>
This is the right order to display the ad using do_shortcode function:
I will use custom ad 1 as example:
– paste the ad code in theme panel > ads. custom ad 1: http://screencast.com/t/I4fGyfFoyc
– get the ad spot’s shortcode. To get the shortcode add an ad box into a blank page then switch in back-end editor copy and paste this code: http://screencast.com/t/Kcqsjk9C7xbU inside do_shortcode function.
– paste the code which renders the shortcode in the file corresponding with the header style used.
For example, if you’re using header style 1 the file which must be edited is header-style-1.php http://screencast.com/t/itasx4W4T – http://screencast.com/t/5vAMrfFwW
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]'); ?>
Thanks!
I am trying this for newspaper theme and getting this error:
Parse error: syntax error, unexpected ‘else’ (T_ELSE) in /home/content/n3pnexwpnas02_data02/30/3153330/html/wp-content/themes/Newspaper/parts/header/ads.php on line 7
This is how my final ads.php looks like..
<div class=”td-header-rec-wrap”>
<?php// show the header ad spot
if (in_category(‘Automotive’)){
echo do_shortcode(‘[td_block_ad_box spot_id="custom_ad_4"]‘);
else {
locate_template(‘parts/header/ads.php’, true);
}
?>
</div>
What am i doing wrong.?
Hi
This is the right order to display the ad using do_shortcode function:
I will use custom ad 1 as example:
– paste the ad code in theme panel > ads. custom ad 1: http://screencast.com/t/I4fGyfFoyc
– get the ad-spot’s shortcode. To get the shortcode add an ad box into a blank page then switch in back-end editor copy and paste this code: http://screencast.com/t/Kcqsjk9C7xbU inside do_shortcode function.
– paste the code which render the shortcode in the file corresponding with the header style used. For example if you’re using header style 1 the file which must be edited is header-style-1.php http://screencast.com/t/itasx4W4T – http://screencast.com/t/5vAMrfFwW
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]'); ?>
Thanks!
-
This reply was modified 10 years by
Andrei L..
Here how i passet the code to custom_ad_1 but add is not display
do_shortcode
<script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
<!– ADD Responsive –>
<ins class=”adsbygoogle”
style=”display:block”
data-ad-format=”auto”></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
You want me to add this do_shortcode() or do_shortcode at ad-spot and add my html code
Hi
The code it’s tested and works fine on my side.
Make sure that you added the file corresponding with the header style used and also check if the shortcode added in do_shortcode function is the one for the ad-spot where you inserted the ad-code in theme panel. Also check our documentation regarding banner ad’s usage: https://forum.tagdiv.com/newsmag-using-other-ads/
Thanks!
Hi
Sorry about that. Your code wasn’t executed because it is interpreted as a plain text. Try to add this code, now it should work fine:
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_2"]'); ?>
Thanks!
-
This reply was modified 10 years by
Andrei L..
i try but is not display. i went theme panel > ads and i add this html code <iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/NM0bZdZod2E” frameborder=”0″ allowfullscreen></iframe> to custom 1 than i went to header style- 1 than i add the < ?php echo do_shortcode(‘[td_block_ad_box spot_id="custom_ad_1"]‘); ?> here the url of the site http://www.guineehitmusique.com is not display the add i try google add too but not dispaly