No search results were found in Documentation!
Hi
The theme doesn’t have an option to display different types of ads on the site, for example the header ad will be displayed from the same spot on all pages and posts. If you want a different ad for homepage you need to add a condition in ads.php file like here: http://screencast.com/t/BqOhbFzqqpGS and insert the shortcode corresponding with the ad spotthat you want to use. To get the shortcode add an ad box into a blank page then switch in backend editor copy and paste this code: http://screencast.com/t/Kcqsjk9C7xbU inside do_shortcode function
For the ads from page content you can use the ad box block and use the corresponding spot for your ad: http://screencast.com/t/YlkV5d5yke
Let me know how it goes.
Thanks!
Hello Sejpost,
In order to modify the theme files you need to know a bit of php. Just adding the shortcode is not goiung to cut it this time. You have to change the code a bit and use $buffy .=
Add this code:
$buffy .= do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');
here:
http://screencast.com/t/RpjhhiByvjoi
The result:
http://screencast.com/t/22LUCz3KP6s5
Thank you!
Hi
Trying to insert a custom ad spot into the mega menu. I know that it’s td_block_mega_menu.php that needs altering (we have a child theme) but I’m breaking the php file by adding shortcodes.
Can you illustrate where in the td_block_mega_menu.php file we’d call our shortcode
<?php echo do_shortcode(‘[td_block_ad_box spot_id="custom_ad_1"]‘);?>
Thanks
S
Hi
You can add the trending now block in post by pasting the shotcode in post content like here: http://screencast.com/t/OCJieBdIr or a easiest way would be to edit the file template corresponding with the post template used, and add this line of code like here: http://screencast.com/t/Jf5SKCFx5Pka – http://screencast.com/t/7j8xHNyc6
<?php echo do_shortcode('[vc_row][vc_column][td_block_trending_now][/vc_column][/vc_row]'); ?>
Let me know how it goes.
Thanks!
-
This reply was modified 10 years by
Andrei L..
Hi,
You can use it in the code without any issues if you want that(referring to Taboola).
Also you can do the same with the fb comments shortcode like Emil suggested above, just use do_shortcode function in the post template file that you use – http://screencast.com/t/0QxLVm3F23
A solution for your modifications to not be overwritten would be child theme, here you can read more about it(also the supported files) – https://forum.tagdiv.com/the-child-theme-support-tutorial/
Thanks!
Hi,
You have to use the do_shortcode() function, ex: – http://screencast.com/t/hiReGi3XIIiI
<?php echo do_shortcode('[fbcomments]'); ?>
From your image i see you also have a widget with news From The Web, i suspect it comes from a plugin and it’s automatically placed at the end of the content. If you want a custom position you have to check the plugin documentation.
The Facebook plugin documentation can be found here – http://peadig.com/wordpress-plugins/facebook-comments/ – you can see that it explains how to add it on a template – http://screencast.com/t/mcVunQvadc – you have to look for similar info about the plugin which displays the From The Web widget.
Thank you!
Hi
You need to edit the files td_smart_list_7.php and td_smart_list_8.php add this line of code like here: http://screencast.com/t/gXAIgFblg
$buffy .= do_shortcode('[td_block_ad_box spot_id="content_bottom"]');
The result should be like here: http://screencast.com/t/Et2xbyVMKfp8
If you want to display a different ad then article bottom ad, replace in do_shortcode function the shortcode with the one for your ad: http://screencast.com/t/IYPLoXEG9 – http://screencast.com/t/pFkibIBQ
Thanks!
-
This reply was modified 10 years by
Andrei L..
Hi,
The theme ad system was designed to work with adsense code, but you cannot add 2 codes in the same spot if this is what you mean.
A solution to have another ad(code) on mobile device will be to paste your code in a custom ad and use do_shortcode function to place it bellow the menu. I don’t know what header style you use, but for example if you use the default template(style 1) you will have to edit header-style-1.php file something like this – http://screencast.com/t/lNgxrndDO If both codes are adsense you can control the them from Theme Panel(disable/enable on specific devices) – http://screencast.com/t/qpivlfoce – http://screencast.com/t/Zm5sI295oJ If one of them is not adsesne you can use those div containers – https://forum.tagdiv.com/header-ad/
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');?>
Result: http://screencast.com/t/wRTRcHElUNn – http://screencast.com/t/c8gXY3uDqc
Thanks!
-
This reply was modified 10 years by
Alin [tagDiv].
Hi
To add elements from Visual Composer after pagination you need to edit page-pagebuilder-latest.php file and use do_shortcode function like here: http://screencast.com/t/CrUCFPyG1v3 – http://screencast.com/t/UIx2rR45k1Mm
<div class="td-container">
<?php echo do_shortcode('[vc_row][vc_column][td_block_3 limit="6"][/vc_column][/vc_row]'); ?>
</div>
First you have to create your layout in VC then switch in Backend editor, copy the code and paste it inside the function like in the above example.
Let me know how it goes.
Thanks!
-
This reply was modified 10 years by
Andrei L..
Hi
You can use do_shortcode function to display a shortcode, the code would look like this:
echo do_shortcode('your shortcode');
I am not sure what shortcode you want to use but you may need additional customization to integrate it. This customization involve some coding knowledge and if you don’t know how to do it yourself, my advice is to look for a developer from sites like http://studio.envato.com/ to do it for you, as we cannot offer any custom work at this moment.
Thanks!
Hi,
You can use do_shortcode function and display 2 custom ads bellow the menu for all pages like this:
*edit header template that you use(I guess it is default) and add the code – http://screencast.com/t/aSDNZlOzk
<div class="td-container">
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');?>
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_2"]');?>
</div>
*use this custom css in Theme Panel > Custom Css – http://screencast.com/t/dFXToqBr
.td-header-style-1 .td-a-rec-id-custom_ad_1 {
float: left;
margin-right: 20px;
}
.td-header-style-1 .td-a-rec-id-custom_ad_2 {
float: left;
}
Please not that this is an example how this can be achieved. For non-adsense code we suggest to use this div container and add a specific image size for each device – https://forum.tagdiv.com/header-ad/
If you use adsense code you can control the size from Theme Panel for each ad spot – http://screencast.com/t/Nczvl9AbRGHY
If you don’t have basic php/html/css experience I suggest to hire a professional developer to do this for you.
Thanks!
-
This reply was modified 10 years by
Alin [tagDiv].
-
This reply was modified 10 years by
Alin [tagDiv].
Hello Hannah,
In order to move the article bottom under the sharing buttons you have to remove the article bottom add and then place a cutom ad in it’s place.
First step: comment these lines: – http://screencast.com/t/2C8GXXucV2Q
Then make sure you have an ad place in the custom ad 1 box in the theme panel->ads->custom ad 1
Then you need to use this code in every single post style you use.
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');?>
The default post template is loop-single, style 1 is loop-single-1, style 2 is loop-single-2 etc. http://screencast.com/t/aiP5OKjEQ
Place the php code under the social sharing bottom
http://screencast.com/t/gA0WhG9d
The result: http://screencast.com/t/hTAPYrUrkO
-
This reply was modified 10 years by
Bogdan B..
Hi
You need to edit the file corresponding with the post template used and add this line of code like here: http://screencast.com/t/Lsi1uJjNRywE
<?php echo do_shortcode('[fbcomments]'); ?>
Also you need to disable the plugin from post content to avoid duplication: http://screencast.com/t/OgQkRKyDk The result should be like here: http://screencast.com/t/jpaR7ItXa99
Let me know how it goes and provide more details if you need further instructions on this.
Thanks!
-
This reply was modified 10 years by
Andrei L..
I found that there is a function being called when you add a post that parses the content and processes the shortcode
Managed to find it and it now works – here is my very specific solution
<h3>Videos</h3>
<?php
$videos = get_posts(array(
'post_type' => 'post',
'category' => 53,
'meta_query' => array(
array(
'key' => 'article_event', // name of custom field
'value' => '"'.get_the_ID().'"', // matches exaclty 123", not just 123. This prevents a match for "1234"
'compare' => 'LIKE'
)
)
));
//echo get_the_ID();
if( $videos ):
$vID = '';
$vArray = array();
foreach( $videos as $video ):
$vID .= get_field( "article_video_id", $video->ID ) .',';
$vArray[] = get_field( "article_video_id", $video->ID );
endforeach;
endif;
$vID = rtrim($vID, ',');
function jj_get_video_info_data ($array_param){
$list_to_parse = $array_param;
$list_to_parse = explode(',', $list_to_parse);
$buffy = array();
//echo $list_to_parse;
foreach($list_to_parse as $id_video) {
$id_video = trim($id_video);//possible to have spaces
//echo '['.$id_video.']';
$response = wp_remote_get('https://www.googleapis.com/youtube/v3/videos?id=' . $id_video . '&part=id,contentDetails,snippet&key=AIzaSyBneuqXGHEXQiJlWUOv23_FA4CzpsHaS6I', array(
'sslverify' => false
));
if (is_wp_error($response)) {
break;
}
$data = wp_remote_retrieve_body($response);
if (is_wp_error($data)) {
break;
}
$obj = json_decode($data, true);
$buffy[$id_video]['thumb'] = td_global::$http_or_https . '://img.youtube.com/vi/' . $id_video . '/default.jpg';
$duration = $obj['items'][0]['contentDetails']['duration'];
if (!empty($duration)) {
preg_match('/(\d+)H/', $duration, $match);
$h = count($match) ? filter_var($match[0], FILTER_SANITIZE_NUMBER_INT) : 0;
preg_match('/(\d+)M/', $duration, $match);
$m = count($match) ? filter_var($match[0], FILTER_SANITIZE_NUMBER_INT) : 0;
preg_match('/(\d+)S/', $duration, $match);
$s = count($match) ? filter_var($match[0], FILTER_SANITIZE_NUMBER_INT) : 0;
$buffy[$id_video]['title'] = $obj['items'][0]['snippet']['title'];
$buffy[$id_video]['time'] = gmdate("H:i:s", intval($h * 3600 + $m * 60 + $s));
}
}
if(!empty($buffy)) {
return $buffy;
} else {
return;
}
}
$td_playlist_video['youtube_ids'] = jj_get_video_info_data($vID);
$td_playlist_video['youtube_title'] = 'Whatever';
//print_r($td_playlist_video);
update_post_meta(get_the_ID(),'td_playlist_video',$td_playlist_video);
$videoSC = '[vc_row][vc_column][td_block_video_youtube playlist_title="TITLE" playlist_yt="'.$vID.'"][/vc_column][/vc_row]';
echo do_shortcode($videoSC);
?>
Here is my code in my template file
$videoSC = '[vc_row][vc_column][td_block_video_youtube playlist_title="TITLE" playlist_yt="'.$vID.'"][/vc_column][/vc_row]';
echo do_shortcode($videoSC);
echo ($videoSC);
The last line is for debugging and outputs
[vc_row][vc_column][td_block_video_youtube playlist_title="TITLE" playlist_yt="Gb6JRborcOU,Xi0S2xKXSzg,ZGzup1LR9NU"][/vc_column][/vc_row]
When I plug that into a post, it views fine. However in the custom template, all I get is
<div class="vc_row wpb_row td-pb-row">
<div class="wpb_column vc_column_container td-pb-span12">
<div class="wpb_wrapper">
<div class="td_block_wrap td_block_video_playlist">
<div id="td_uid_11_56027c1641664" class="td_block_inner"></div>
</div> <!-- ./block_video_playlist -->
</div>
</div>
</div>
Please advise!
Hello murakami9.
Please replace the lines I have marked in this image from ‘single.php’: http://screencast.com/t/wNkcby3T05 with this code:
echo do_shortcode('[fbcomments]');
Make sure to uncheck the post comments in the plugin or they will be doubled
result: http://screencast.com/t/rDCliXPlGO
This will change the default comments to Facebook ones but only on posts with the default template selected.
If you use another post template, you will need to modify the other files with the number corresponding to the template used: http://screencast.com/t/r7xs3oegMm2.
I hope this will bring light to the subject
Thank you!
Code:
<?php
$theShortcode = '[vc_row][vc_column][td_block_15 custom_title="Related Articles" td_ajax_filter_type="td_category_ids_filter" ajax_pagination="next_prev"][/vc_column][/vc_row]';
echo do_shortcode($theShortcode);
?>
This works fine (apart from an issue with the category box dropping a few pixels which I have raised in another post). However there’s no option to filter based on post ID like you can with the Post Grid/Post Masonry Grid options. Is there a simple enough way to achieve this here?
I’d love to use Post Grid/Post Masonry Grid in the above example but unfortunately as per the plugin authors reasoning:
Currently it is not possible because Grid requires special hashkey which is stored in meta data of the each post. Each hashkey is unique and related to information in meta about grid attributes. The reason of such implementation is security. Because vc getting data grid from ajax request and data passed to this request is ID.
Example URLs: http://beta.virtualfestivals.com/uncategorized/164812/ and http://beta.virtualfestivals.com/event/reading-festival-2015/
Specifically on the 2nd one, the category title seems to have dropped down a few pixels. It’s a custom post using the do_shortcode function
Shortcode:
[vc_row][vc_column][td_block_15 td_ajax_filter_type="td_category_ids_filter" ajax_pagination="next_prev"][/vc_column][/vc_row]
Any advice? Also, any advice on how to filter posts based on post ID e.g. only show posts with ID 1,5,6…,488
Thanks
Hi,
Do you want a similar block like Related Articles to display posts from specific category? You could add a block to a page and filer posts by specific category then take the block shortcode and use do_shortcode() function bellow the related articles code in the template that you use, it may need some additional css customization – http://screencast.com/t/0qfRLEEiD – https://codex.wordpress.org/it:Riferimento_funzioni/do_shortcode Please note that this widget will appear on all your posts from all categories, not only on specific one.
If you don’t have basic experience I suggest to hire a freelancer to do this for you as we cannot provide custom work at this time, sorry!
Thanks!
Hi
If you’re using adsense code a solution would be to add the code in Theme Panel > Ads section in theme’s custom ad spots: http://screencast.com/t/DjDIQo9UEc7 and use do_shortcode function in every post template files corresponding with the post template used – http://screencast.com/t/OnJ6x0h0Z to display the ads.
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');?>
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_2"]');?>
Also you will need this custom css – http://screencast.com/t/uuiWen8QXqXg
.td-g-rec-id-custom_ad_1, .td-g-rec-id-custom_ad_2 {
float: left;
margin: 0 0 20px 20px!important;
}
Note that I didn’t test this on every post template so you may need additional customization and if you don’t know how to do it yourself I suggest to hire a professional developer from sites like http://studio.envato.com/ as we cannot provide custom work.
Thanks!
Hi
To add a padding beside the facebook comments you can use this classes like here: http://screencast.com/t/qC8GBwB1 – http://screencast.com/t/yAPaPTtcQWuo
<div class="td-post-content td-pb-padding-side">
<?php echo do_shortcode('[fbcomments]'); ?>
</div>
Thanks!
-
This reply was modified 10 years by
Andrei L..
Hi there
I am using the Peadig Facebook comments plugin and have disabled the built in comments and the default facebook comments for posts and have put in this code to loop-single.pgp
<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 do_shortcode('[fbcomments]'); ?>
<?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>
I want to add padding on the left, where/how to do it?
<script async src=”//s.imgur.com/min/embed.js” charset=”utf-8″></script>
Thanks
Hello davidtiquet,
As i understand you need to use the “your latest posts” homepage which uses the index.php file but with a different layout, one resembling newsmag homepage. This requires some custom modifications which we cannot provide. But i can point you in the right direction:
You will need a bit of PHP knowledge to do this.
You can use a function: <?php echo do_shortcode(''); ?> in your index.php file below the like so: http://screencast.com/t/D092zLsbJtq. (You need to add it to that specific container or it will lose its styling.)
Inside the shortcode function you will place the visual composer shortcodes you see in classic mode: http://screencast.com/t/g0C1VpiMWA – http://screencast.com/t/g0C1VpiMWA.
It should llok like this: <?php echo do_shortcode('[vc_row][vc_column][td_block_2][/vc_column][/vc_row][vc_row][vc_column][td_block_15][/vc_column][/vc_row]'); ?>.
This will bring the blocks from visual composer to your index page.
I hope this helps.
Thank you!
Hi
First you need to remove the article bottom add from post content like here: http://screencast.com/t/PWgzx852 After that you can use the do_shortcode(' ') function and insert the ad shortcode from VC: http://screencast.com/t/W4SFKPnoShn – http://screencast.com/t/lqaJxdVdMee at page bottom in post template files corresponding for the post templates used: http://screencast.com/t/NujhBJ9CB – http://screencast.com/t/7dYEalH9
Let me know how it goes and provide more details if you still need assistance on this.
Thanks!
Hi
You can use do_shortcode function to display article inline, bottom and top ad, in smart lists template file: http://screencast.com/t/8w1MOQwu – http://screencast.com/t/BYfH4ztN – http://screencast.com/t/rzbedxvYY5H
$buffy .= do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');
Add this line whee you want to display the ad.
Thanks!
-
This reply was modified 10 years by
Andrei L..