Hello,
I con’t figure out how to add a block to the end of post (main template).
I figured out to how to set up a homepage using visual composer. I watched tutorial.
I just don’t understand is it possible to add block to every post that is using regular template.
I know in Theme panel there is Post setting -> Default site post template.
Is it possible to create template that at the end of post has blocks?
Thank you in advance.
Hello croboy,
Visual composer was not tested on posts. It has that option and you can add blocks to your post , but you will need custom CSS modification to position it.
You can add a padding to it with CSS:
.single-post .td_block_wrap{
padding-top:50px
}
Place it in the theme panel-custom CSS box.
This code adds a padding to all block elements on posts (all of them will stick to the text without a padding or margin set to them). You can tweak the value in the code to your preference.
Thanks.
Hi Bogdan,
Thank you for a quick replay. Is there a way to make a custom post template that will include block at the end of every post or to hardcode it in main post template? I am really surprised that is not possible by default.
I am thinking to use article bottom ad for that but I would like to combine text with adsense code and theme is deleting everything except the adsense code. Is there a way that adsense code is not modified/resized? I think it would be great if you could have option “Use only original size” and in that case not to change code.
Thank you
Hello,
Unfortunately the theme does not have an option for it, so you have to use the code method. You can use a ‘do_shortcode’ function: <?php echo do_shortcode('your shortcode here');?> and place it in the post template you use on your post (loop_single.php if it is the default one)
Every post template has a file to go with it. The default is without a number to it. The others correspond to their post template number.
You can add for example a trending now block in posts by editing 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]'); ?>
As for the ads, the theme uses adsense code and every other custom ones have to be done by using this method here: https://forum.tagdiv.com/using-other-ads/
I hope this helps
Thanks!
-
This reply was modified 10 years by
Bogdan B..
Hi,
This is exactly what I need. Just one more question about this and I hope it is not out of the scope of support.
Is it possible to define block settings in this way?
I saw this https://forum.tagdiv.com/practical-example-how-to-add-a-new-block-and-module/
but I don’t know PHP. I hope it is possible to define number of articles and category.
Anyway thank you a lot for your help. I hope this will help other customers beacuse it is really great to have blocks beneath article.
I figured it out. I used visual composer to add block and then switched to classic mode and g otcode.
🙂
<?php echo do_shortcode('[vc_row][vc_column][td_block_16 custom_title="Name of block title" category_id="XYZ" limit="5"][/vc_column][/vc_row]'); ?>
Tnx anyway
-
This reply was modified 10 years by
croboy.