- ApiPractical example – How to add a new Block and Module
- Apitd_api_block::delete
- Apitd_api_block::update_key
- Apitd_api_block::update
- Apitd_api_block::add
- ApiAPI – Blocks – Introduction
- Apitd_api_thumb::update_key
- Apitd_api_thumb::update
- Apitd_api_thumb::add
- ApiAPI – Thumbnail – Introduction
- Apitd_api_category_top_posts_style::update_key
- Apitd_api_category_top_posts_style::update
- Apitd_api_category_top_posts_style::add
- ApiAPI – Category top section style – Introduction
- Apitd_api_module::update_key
- Apitd_api_module::update
- Apitd_api_module::add
- ApiAPI – Modules – Introduction
- ApiUsing the Theme API in plugins
- ApiThe Theme API
Okay, here’s the answer for anyone else who may care about inserting custom fields in modules or blocks.
I couldn’t initially display a simple custom field from a target post in a module. The usual code for displaying a custom field in WordPress is something like:
<?php echo get_post_meta($post->ID, 'your_custom_field_name',TRUE); ?>
For reference, that snippet opens php code (?php) and displays text (echo) using the WordPress get_post_meta function. The $post->ID identifies the relevant post, ‘your_custom_field_name’ is the name of your custom field, and TRUE indicates that you just want one value.
Unfortunately, using that code only showed metadata from the parent page where the module was embedded, not the post being pulled in for the module. Fortunately, the solution was stupidly simple. You just need to add $this to reference the post ID being constructed in the module. That looks like:
<?php echo get_post_meta($this->post->ID, 'your_custom_field_name',TRUE); ?>
The standard WordPress codex info is insufficient without understanding some basics on object oriented code.
Hi, i know that there’s advance css on theme panel for mobile, but how do i change the module size?
please refer from this screenshot:
In big grid, the module is split into two per row. While block 16 becomes 1 big module per row.
How do i make block 16 to split into two per row just like in big grid?
Thanks!
Thank you! That worked flawlessly.
The screenshot that you shared. In it, just on the side of block title, their are tabs like ‘All’, ‘Vogue’, etc. How can I add such on my website?
The blocks were already implemented from the Default newspaper setting and I cannot see step by step how to get to block setting and edit the titles that were chosen randomly by Newspaper. How do I go about it. Also, since I installed this theme and activated it, I realised that pages and especially images take a long time to load. So pages cannot load fast and block names can not be changed. How can you please help? Thank you. The screen shot could not show much.
Hi
Try this css in theme panel > custom code > custom css: http://screencast.com/t/9ULFc6a1dlaa
.td_block_wrap .td-module-comments, .td_block_wrap .td-post-author-name span, .td_block_wrap .td-post-date{
display: none;
}
Thanks!
Hi, how do i remove the date and comments and blocks and big grids? also the “-” between author name and date.
Hi.
It seems I forgot the php tag. Sorry :).
Please try this code:
<?php
if ($num_comments > 0){ ?>
<div class="td-comments-title-wrap <?php echo $td_css_cls_pb_padding_side ?>">
<h4 class="<?php echo $td_css_cls_block_title ?>"><span><?php echo $td_comments_no_text?></span></h4>
</div>
<?php }; ?>
Thanks.
Hi,
They look like the same size from your screenshot and they should be the same size as this is how the theme was built. It uses the same thumbnail size for all the posts inside a block element. if they really have different sizes, it means that you do not have the thumbnail activated from the block settings here:
http://screencast.com/t/7LP3lGhKDs
If you did not regenerate your thumbnails after you switched to newspaper, then you should fo it now as the theme needs it’s thumbnail sizes to be created. Please follow this guide:
https://forum.tagdiv.com/thumbnails-fix-strange-looking-images-on-blocks/
Hope this helps.
Thank you!
Thanks. That kind of works but it seems to cause a bigger problem.
It caused all the content in my posts that are under “wp text blocks” to disappear. Example: http://www.screencast.com/t/Pj9WyptbP
So I needed to put the old code back.
Best wishes
Lars
Hi,
Yes, the code only works for the 2 column block. If you want to adjust it on the 1 column as well, please use this code:
.td_block_11 .td-module-thumb{
display:none!important;
}
.td_block_11 .td_module_10 .item-details {
margin-left: 0!important;
min-height: 0!important;
}
.td_block_11 .td_module_10{
padding-bottom:10px!important
}
.td_block_11 .td_module_10 .entry-title{
padding-left:0!important;
min-height: 20px!important;
}
(replace the old code)
Thanks.
Hi Bogdan – Thanks for your quick response. The code provided by you works good for the blocks. But what about the widgets in the sidebar. I am interested to remove the white spaces from there.
Can you please help.
Thanks
Hi,
Unfortunately there is no setting for this, but it can be done by adding an extra condition in the php files.
Please replace this part: http://screencast.com/t/AiASlqmqEd with this code:
if ($num_comments > 0){ ?>
<div class="td-comments-title-wrap <?php echo $td_css_cls_pb_padding_side ?>">
<h4 class="<?php echo $td_css_cls_block_title ?>"><span><?php echo $td_comments_no_text?></span></h4>
</div>
<?php }; ?>
It should look like this:
http://screencast.com/t/UW6NlpRg55e
Thank you!
I just want to make the fixed size to be same just in the attached image
http://Teamreporters.com/wp-content/uploads/2016/03/sam.bmp
in block 19 i saw the 2 top images are larger than the other ones below, i want all to be same size
Hi,
As you can see, the topic is form almost 2 years back. The code will not work anymore as the theme has been updated many times since then. You can target your blocks using the browser inspector and use the specific css classes like so: http://screencast.com/t/IklwH06h21Xq
In this case, if you want to remove the padding, you would use the code like so:
.td_block_7.td_block_wrap{
padding-bottom: 0!important;
}
I also added the block 7 class so the code will be more specific as multiple blocks use the .td_block_wrap class and if I were to only leave this class in the code, ALL the blocks will have the padding removed.
Hope this helps.
Thank you!
Hi,
Block titles can be edited from block settings. When you create a new block the block settings will pop-up onscreen. If the block is already implemented, you can access the settings from the little pencil icon here: http://screencast.com/t/ZEeS5vR9S4H4
Thank you!
Hi,
I’m not sure where you are getting this error. We never saw this error on the homepage before, nor is there a block 27. There are only 21 blocks in our theme. We know of a similar issue that comes up in module 16 in the search template for posts that have no featured image set to them: http://screencast.com/t/SJyrSuZpn (do not use module 16). This will be fixed in the next version of the theme.
Please provide more details if this is not the same search page error.
Thank you!
Hi,
You can edit loo-single-1.php from the rrot directory like so: http://screencast.com/t/jRjih2t0k
And add this code:
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');?>
Make sure you have an ad in the custom ad 1 spot
Thank you!
Hi
I’ve checked our site and noticed that the theme load the wrong image at the wrong sizes on modules: http://screencast.com/t/8PvhEJ3hbhG I am not sure why this happens but you can try to regenerate your thumbnails for this image following this guide: https://forum.tagdiv.com/thumbnails-fix-strange-looking-images-on-blocks/ clear the cache memory and test again.
Thanks!
Hello applepexky,
I have checked your code and I saw that you have some differences about your code. As you can see in this screenshot here -> http://screencast.com/t/zueHP8G5aI9n appear differences to your quotes. Please copy/paste the code directly from here -> http://webmasters.stackexchange.com/questions/71630/font-blocked-from-loading-by-cross-origin-resource-sharing-policy-no-access-co and not from our forum because the code will be affected and will still do not work. Most of our users that use CDN and have this problem was solved with this workaround. If you do not use CDN file and yet you have this issue with the fonts (Chinese fonts), please check your hosting provider in this regard.
Hope this helps and let us know how it goes!
Thank you for the message!
Hello hatchet9,
I suppose that you want to have for Block 5 3 column for desktop mode and 2 column for Tablet mode. Unfortunately, our theme does not have such an option in this case, sorry! Please notice that our Blocks are built in modules and have a precise layout in the theme. If you want to change this functionality to some cases, please notice that is not a simple task and require more additional customizations through code that involve custom work. As a hint, here you can see the code for Block 5 -> http://screencast.com/t/uiMSCAREKu and there you have to do the changes if you want to change the functionality for this kind of block. If you are not aware of the steps in this regard, please consider hiring a freelancer/developer to help you in this case, because we cannot provide customization services at the moment, sorry!
Thank you for your understanding!
Hi,
You can see a list of what modules are used in what block here: http://screencast.com/t/1Pfm9YqkV
Block 5 uses module 3: http://screencast.com/t/PqE9niCGfrlB
If you want to change the image size, you need to use the theme api guide here: https://forum.tagdiv.com/api-thumbnail-introduction/
Thank you!
Hello
2)As you can see in this screenshot here -> http://screencast.com/t/jFkFImgG8L3 if you want to have the same layout for your sidebar you have to add Block 21 into your Sidebar area.
3)4a) That is Block 2 -> http://screencast.com/t/CBwmpEXudqy Please consult our demo here -> http://demo.tagdiv.com/newspaper/block-2/
6)Yes, these are WP plugins and for more information about these, please consult the documentation here -> https://wordpress.org/plugins/regenerate-thumbnails/ -> https://wordpress.org/plugins/thumbnail-upscale/ Please notice that these kinds of plugins are not tested with our theme but seems to work as properly with the theme and a lot of users uses them and we have no bad reports about its functionality.
7)If you want to see any changes into your footer when you add some widgets in this section, you have to use Footer template style 5 because it is a custom template and you can customize it as you wish.
-> http://screencast.com/t/VZxZPXTa
New question:
1)Unfortunately, our theme does not have such an option to change this duration, sorry! If you want to change it, you have to alter the code and this involves custom work. If you want to do this and 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!
2)Please check your setup page for your homepage and try to remove them from there. -> http://screencast.com/t/aJcX7URFC I suppose that H4 tag with ul attribute was put manually from the panel or maybe come from your plugins.
3)In this case, is used Block 19 and the meta info are included into the thumb as in your screenshot -> http://demo.tagdiv.com/newspaper/block-19/
4)You can change the link only from Theme panel, like this -> http://screencast.com/t/RRs7JudGATB and if you want to change the color of the link you have to use a bit of CSS code to do that.
The code is ->
.footer-email-wrap a {
color:white!important;
}
The result -> http://screencast.com/t/fTaI3uB7WdM
5)Please try the code below and place it in Theme panel->Custom CSS area.
The code is ->
.td-subcat-filter .td-subcat-dropdown:hover .td-subcat-more {
background-color:red;
}
The result -> http://screencast.com/t/Lro2Q8EWsl
Hope this helps!
Thank you for the message!
Hi
I’ve checked your site and found this error in browser’s console: http://screencast.com/t/mdEG4pkw
This usually happens when the font is loaded from a different source or it’s served from http to https. Try this solution, from our reports it worked from most users: http://webmasters.stackexchange.com/questions/71630/font-blocked-from-loading-by-cross-origin-resource-sharing-policy-no-access-co
Thanks!
Hi,
If you want to edit block 14, then there are multiple files you can try to edit the block in.
There is the block file here: http://screencast.com/t/vHUYUriWH
If you want to change the posts inside the block, then you need to edit the module used in block 14 here: http://screencast.com/t/5xjDrO3np
So there is no one single file you need to edit. Php is a ‘network’ of different files and every element that is called in one file, has it’s code in another one.
Thank you!
Hi,
There are no settings for this so it will have to be made custom. You will have to know a bit of html and css to get it done.
For the first design you can use this code:
.block-title span{
background-color:transparent!important;
border-bottom: 2px solid green;
}
http://screencast.com/t/YGkfI33WR8o
For the second design you can use this css:
.block-title span{
background-color:transparent!important;
}
http://screencast.com/t/wzSvjSqlYc
And you have to edit the block and set the block title to another color besides white.
Right now the codes will apply to all of the elements. You need to target the individual classes of the blocks you want the titles to apply to. You can add extra classes to the row in visual composer to help you target elements better.
Hope this helps.
Thanks.