- ApiPractical example – How to add a new Block and Module
- Apitd_api_top_bar_template::delete
- Apitd_api_top_bar_template::update_key
- Apitd_api_top_bar_template::update
- Apitd_api_top_bar_template::add
- Apitd_api_single_template::delete
- Apitd_api_single_template::update_key
- Apitd_api_single_template::update
- Apitd_api_single_template::add
- Apitd_api_footer_template::delete
- Apitd_api_footer_template::update_key
- Apitd_api_footer_template::update
- Apitd_api_footer_template::add
- Apitd_api_smart_list::delete
- Apitd_api_smart_list::update_key
- Apitd_api_smart_list::update
- Apitd_api_smart_list::add
- Apitd_api_thumb::delete
- Apitd_api_thumb::update_key
- Apitd_api_thumb::update
Hello,
I have followed the tutorial here –
https://forum.tagdiv.com/practical-example-how-to-add-a-new-block-and-module/
To add new blocks and modules to the site. However on these new blocks the ajax filtering does not work and throws an error! It also stops images bellow the block from loading.
If I comment out this line in the code the lazy load works but no filtering –
$buffy .= $this->get_pull_down_filter();
I have tracked it down to this function always returning as zero –
get_td_pull_down_items
What can I do to get the ajax filtering to work on custom block modules?
This is my full block code –
<?php
// v3 - for wp_010
class td_block_27 extends td_block {
function render($atts, $content = null) {
parent::render($atts); // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query)
$buffy = ''; //output buffer
//get the js for this block
$buffy .= $this->get_block_js();
$buffy .= '<div class="' . $this->get_block_classes() . '">';
//get the block title
$buffy .= $this->get_block_title();
//get the sub category filter for this block
//$buffy .= $this->get_pull_down_filter();
$buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner">';
$buffy .= $this->inner($this->td_query->posts); //inner content of the block
$buffy .= '</div>';
//get the ajax pagination for this block
$buffy .= $this->get_block_pagination();
$buffy .= '</div> <!-- ./block -->';
return $buffy;
}
function inner($posts, $td_column_number = '') {
$buffy = '';
$td_block_layout = new td_block_layout();
if (empty($td_column_number)) {
$td_column_number = td_global::vc_get_column_number(); // get the column width of the block from the page builder API
}
$td_post_count = 0; // the number of posts rendered
$td_current_column = 1; //the current columng
$td_column_number = 1;
if (!empty($posts)) {
foreach ($posts as $post) {
$td_module_27 = new td_module_27($post);
switch ($td_column_number) {
case '1': //one column layout
$buffy .= $td_block_layout->open12(); //added in 010 theme - span 12 doesn't use rows
$buffy .= $td_module_27->render($post);
$buffy .= $td_block_layout->close12();
break;
case '2': //two column layout
$buffy .= $td_block_layout->open_row();
$buffy .= $td_block_layout->open6();
$buffy .= $td_module_27->render($post);
$buffy .= $td_block_layout->close6();
if ($td_current_column == 2) {
$buffy .= $td_block_layout->close_row();
}
break;
case '3': //three column layout
$buffy .= $td_block_layout->open_row();
$buffy .= $td_block_layout->open4();
$buffy .= $td_module_27->render($post);
$buffy .= $td_block_layout->close4();
if ($td_current_column == 3) {
$buffy .= $td_block_layout->close_row();
}
break;
}
//current column
if ($td_current_column == $td_column_number) {
$td_current_column = 1;
} else {
$td_current_column++;
}
$td_post_count++;
}
}
$buffy .= $td_block_layout->close_all_tags();
return $buffy;
}
/**
* renders the filter of the block
* @return string
*/
function get_pull_down_filter() {
$buffy = '';
$td_pull_down_items = $this->get_td_pull_down_items();
if (empty($td_pull_down_items)) {
return '';
}
//generate unique id for this pull down filter control
$pull_down_wrapper_id = "td_pulldown_" . $this->get_block_uid();
// wrapper
$buffy .= '<div class="td-pulldown-syle-default td-subcat-filter" id="' . $pull_down_wrapper_id . '">';
// subcategory list
$buffy .= '<ul class="td-subcat-list" id="' . $pull_down_wrapper_id . '_list">';
foreach ($td_pull_down_items as $item) {
$buffy .= '<li class="td-subcat-item">get_block_uid() . '" href="#">' . $item['name'] . '';
}
$buffy .= '';
// subcategory dropdown list
$buffy .= '<div class="td-subcat-dropdown">';
$buffy .= '<div class="td-subcat-more" aria-haspopup="true"><span>' . __td('More', TD_THEME_NAME) . '</span><i class="td-icon-read-down"></i></div>';
// the dropdown list
$buffy .= '<ul class="td-pulldown-filter-list">';
$buffy .= '';
$buffy .= '</div>';
$buffy .= '</div>';
return $buffy;
}
}
Thanks!
Hallo.
I Have problem with Comments on posts. the option to write comments are missing.
this is a new problem. i had comments ability on post before..
Thank you!
http://hayom.org.il/wp-content/uploads/2017/07/No-Comment.jpg
For example: https://goo.gl/kCXPka
Hi,
Yes that post belongs to those three categories. But the category tag displayed on the module will be only one, that of the primary category of the post. By default the primary category is the first one alphabetically.
Without the code this is how that post is displayed on the block
– https://www.screencast.com/t/bzCg8Oli
You wanted to hide the Gallery tag on the module, the code does that. Like I previously mentioned, if a post has multiple categories you can control which category tag will appear on blocks by manually setting a primary category
For example this post has three categories
– https://www.screencast.com/t/8ao6NkRfd
Without setting a primary category manually, the first one alphabetically is displayed
– https://www.screencast.com/t/YUNMwHg0
Setting a primary category has this result
– https://www.screencast.com/t/1Y8vqSFyZ3JG
– https://www.screencast.com/t/bb0WQ0hqHrXd
The post will still be part of those categories, but the tag displayed in the one you choose.
The module only picks the primary category tag, hiding the Gallery tag will not make one of the other category tags to display
– https://www.screencast.com/t/U3m0hVvtA
Thanks
Hello,
The function presented there is meant for posts, not comments. That is why it will not work properly on comments. You will have to adapt the code in order for it to work properly on comments .
Add this code:
<?php printf( _x( '%s ago', '%s = human-readable time difference', 'your-text-domain' ), human_time_diff( get_comment_time( 'U' ), current_time( 'timestamp' ) ) ); ?>
Like so: https://www.screencast.com/t/EIkDG4cR1
result: https://www.screencast.com/t/kuKy2Kkhv6SF
Thanks.
Hello mskssk,
Please notice that the speed of your website depends on how well your site is optimized. Notice that is not a simple task and if you do not have any experience in this regard you will do not bring good results for the theme. Also, notice that we have a speed optimization tutorial but this is addressed only to advanced users. So, if you follow the steps which are presented in this tutorial here -> https://forum.tagdiv.com/how-to-make-the-site-faster/ you can increase the page speed loading and if you are not aware of the steps in this regard, please consider hiring a freelancer/developer to help you because the speed optimization services are not covered by our support policy, as you can read here -> https://forum.tagdiv.com/support-policy-2/ Check our documentation here -> https://forum.tagdiv.com/requirements-for-newspaper/ regarding on dedicated server to fit to our requirements. For an example, you should check our demo preview because this website is optimized.
Thanks for your understanding!
Hi,
The modules that form the blocks can only display what they are meant to, like the date, category tag, author, excerpt etc. The process of handling these predefined elements is done automatically. This is an example of how a module structure looks
– https://www.screencast.com/t/J7PyfrlD
It gets the post information and displays it, the module will not display anything else.
Thanks
Hi,
You could achieve something like that by setting a margin for the body, and the background will display above the header as well. Like this example
– https://www.screencast.com/t/nDyaErBbvYgX
This is the code used in the example (you can modify the margin value as you want). If you decide to use it, enter it in Theme panel->Custom Css section
body {
margin-top: 300px;
}
Thanks
Hi there,
First of all thanks for this great theme. I love it! I am trying to learn it from scratch so I didn’t install any demos yet for the sake of creativity. I use tagdiv Composer which I find great for my kind of work. Naturally I have a couple of questions, if you may answer. 🙂
1- Can I select the category tag colors as hover colors in modules and/or grids? I am trying to get a clear color code for my categories which can be seen here : http://stilltune.com/home/
I added a block with custom title background color for my Music Theory category. It shows up exactly as I want. But as you may notice the Big Grid 9 above inherits the general accent color for categories. Can I show my category tag colors there as hover colors? Because I will have more categories and that Big Grid showing always the same main accent color for hovers would seem a little bit confusing regarding my category color coding. Now I have selected a category tag color for this category too but it doesn’t affect those hovers. It doesn’t even affect that block’s filter choices. I had to enter the block color manually. I guess it only shows up in beside block titles as tag colors, right? I couldn’t see it anywhere else. I found category tag colors a little bit confusing because of this. Maybe a category color concept would be much better? Because main accent color seems to interrupt this color code concept. So what can I do for this? (An example of what I want for that Big Grid can be seen in this demo’s top slider. http://demo.mekshq.com/voice/ Little category tags inherits category tag colors there so that category colors would be consistent everywhere in the theme)
2- Although my Meta Info in Theme Panel/Block Settings/Meta Info on Modules are all open, I cannot see the dates and authors in Module MX26 and MX25 like in a SS you shared in someone else’s forum posts (https://www.screencast.com/t/AQN4wjCydN) Do I need to change something else or add custom css codes for this?
3- I want to see all module names in grids and blocks. Do you have any guide or cheat sheet for them?
Finally one suggestion if I may 🙂
I think Modules and Grids should be edited in detail via tagdiv Composer. I may want to show meta info in one of them but I may not wanna show it in another. But when I select meta info on modules it affects them all. So maybe that edit section of tagdiv composer should be a little bit more detailed. Because otherwise we should enter css manually and the whole concept of “No coding required” is ruined 🙂
Thanks in advance, have a good day
Gökhan
Hello! Thanks for this code. I notice that it does remove the “Gallery” tag on all of the posts, but it unfortunately also removes all of the tags. For example, this post (http://e50.4da.myftpupload.com/day-3-of-spring-2016-new-york-fashion-weeks-most-inspiring/) is in the categories Gallery (which is hidden), Get Inspired, and Music. However, no categories show in Block 5 on the homepage here: http://e50.4da.myftpupload.com/. Can we block just the Gallery tag, and not all of the other categories? Thanks!
This is the message sent by our hosting provider (Flywheel), may we have comments on this?
`
`
It looks like the issues you’re seeing with the errors on this site are being caused by an extremely excessive number of POST requests being made to the server.
It looks like many of them are wp-cron jobs (some kind of scheduled task on the site running a little wild) and a big number of the rest are POST requests being made to admin-ajax.php by the theme itself:
POST /wp-admin/admin-ajax.php?td_theme_name=Newspaper&v=8.0
That’s the specific request that seems to be coming from the theme. Those and the rest of the POST requests are generating 502 or 504 errors by bogging down the server. Even one this powerful can only stand up to so much.
That’s because we’ve done quite a bit to get the site running as it should be on this end of things, including implementing a high level of aggressive caching. But POST requests will undermine those efforts and prevent caching altogether, forcing the server to work as hard as possible on each request. So in essence, what we can do to help performance is invalidated right now.
In order to get the site running optimally—on Flywheel or on any other host—you or a site developer will need to work on reducing those persistent, repetitive POST requests from the site. That’s site development, and it’s beyond the scope of our support, I’m afraid.
You can export the logs from the Advanced tab of the site’s Flywheel Dashboard if you’d like to have a look at what we’re seeing on our end.
Sorry we can’t be more directly helpful than that, but once that’s taken care of we’ll be happy to have another look and make any other suggestions or modifications we can from our side.
`
`
Hi,
That is the category of the post. The modules will display the post category if it is enabled in the theme panel
– https://www.screencast.com/t/04VDR0VH
If you have a post in a category called “Recipes” for example, this category tag will be displayed on blocks for that post. If a post has multiple categories and you want to control which one is displayed on the blocks, you need to set a primary category for the post
– https://forum.tagdiv.com/primary-category/
You can create any categories you need and assign posts to them
– http://www.wpbeginner.com/glossary/category/
Here you can find more information about the category settings and options available in the theme
– https://forum.tagdiv.com/how-category-settings-work/
Thanks
Hi,
Please follow these guides for more information about speed optimization
– https://forum.tagdiv.com/system-status-parameters-guide/
– https://forum.tagdiv.com/how-to-make-the-site-faster/
– https://forum.tagdiv.com/cloudflare-cdn/
There are many topics here on the forum as well, from which you can learn valuable advice. Here are some examples that you can read
– https://forum.tagdiv.com/topic/score-100100-pagespeed-with-newspaper-wordpress-theme/
– https://forum.tagdiv.com/topic/newspaper-theme-speedify-your-website/
Thanks
OK, let the issue drop , it is not critical , but have a question about is it possible for themes to do so , that would have been indented from the top ( that would show in the background in place of background , advertising, advertisers ) ? the example in the screenshot here that’s how this site
Hi,
You could use a bigger image if possible, it should be responsive. If the container does not have a fixed width this is possible. In this example I used a simple link with a big image size, and it is responsive
– https://www.screencast.com/t/si4FUyFSC5iL
– https://www.screencast.com/t/Gt6dNX6K8
– https://www.screencast.com/t/B5usvfcWPW
You could also wrap the code with the div and classes that you mention, and create different ads for specific devices. These classes will work if you place them there, they have corresponding Css media conditions in the theme stylesheet.
Thanks
Hi,
All the menus are created in Appearance->Menus section. That is where menus can be modified and customized as well
– https://www.screencast.com/t/TlIFmb26C
The mega menu is a simple menu item, like this one for example
– https://www.screencast.com/t/HUoSUb5pMWKf
Here you can find more information about menus in general, and mega menus in particular
– https://forum.tagdiv.com/main-menu/
– https://forum.tagdiv.com/mega-menu/
Thanks
Hello,
Sorry but the sort order is not created in css.
If you want a custom sort order, here is an example on how it is created:
https://forum.tagdiv.com/topic/implemented-new-sort-most-popular-among-posts-of-last-7-days/
Alternatively, you can select specific posts you want shown in your block using the post id filter.
Thanks.
Hi,
Please provide an example as I cannot see any issues with any image on your site.
Our theme does indeed have a cropping system mentioned here:
https://forum.tagdiv.com/featured-image/
Here is a list of the different thumbnail sizes used in our theme:
https://forum.tagdiv.com/theme-thumbs/
And this list will show the different modules used on blocks:
https://forum.tagdiv.com/theme-blocks-modules/
Thank you!
Probably need to look up how to hack WordPress for that or Cloudflare support.
Proper URl would be img src="https://example.com/image.jpg"
You’d need to search/replace your content in PHPmyAdmin to replace old instances of http to https for your images placed inside of post meta (lots of tutorials online for moving to https from http in WordPress).
Once you change your base site URL to https in WP, the theme picks up from that for any new posts (you would need to manually change any logo head/footer/favicon stuff in theme panel, obviously).
I don’t work here; but we moved to https everywhere in 2014, 2015 and 2016 for all our sites, so went through the same thing.
I want to edit my source code to fully install cloudflare SSL certificates like,

to

how can i do it?
Am more interested in the page. For example, homepage pagination, news page pagination, blog page pagination or other kinda page that you might wanna add pagination. Mine seems to appear without numbers, and it doesn’t load the whole page when it’s clicked.
Yes, we do get a strange error (403) in the console for the file wp-admin/admin-ajax.php:
Failed to load resource: the server responded with a status of 403 (Forbidden)
http://xxx.xxx/wp-admin/admin-ajax.php?td_theme_name=Newspaper&v=7.5
The file permission is set to 0644.
Hello ahmetekinler,
If you want to create your own custom block and design it by yourself, notice that you could do it only through API implementation system, like this -> https://forum.tagdiv.com/practical-example-how-to-add-a-new-block-and-module/ You should follow all the steps which are presented there. Also, notice that API implementation is not covered by our support and this tutorial is addressed to the advanced users and if you ar not aware of the steps which are needed to take in this regard, please consider hiring a freelancer/developer to help you because we cannot provide custom work, sorry!
Thanks for the message!
Hey!
First of all, I want to thank you for this awesome theme. I have been using it since version 5 for different websites.
Now, for this version 8, I have the following issue: I cannot SAVE DEFAULTs in Theme Panel.
– For example, in the FOOTER section, I can save Style 2 to 14 as Footer Template, but not Style 1. I also cannot SHOW FOOTER anymore, because I deactivated before.
– Another example: BLOCK SETTINGS > BLOCK HEADER TEMPLATE. I can SAVE any Block Header (2 to 17), but NOT Block Header 1 Default.
I checked the System Status, I made all the Settings you suggested in WPConfig and htaccess.
What should I do?
Thank you!
Was able to sort it out under Theme Panel Block & Module Settings.
Thanks.