Hi,
You need to make a modification to show the views.
1. Add <?php echo $this->get_views(); ?> in td_module_9.php like here: http://screencast.com/t/koCkDeey
2. Copy the function get_views() from td_module_single_base.php in td_module.php like here: http://screencast.com/t/6pDj3N6S
3. Used this CSS for a better alignment, add it in Theme Panel -> Custom CSS section
.td_module_wrap .td-module-meta-info .td-post-views {
position: relative;
display: inline-block;
top: 2px;
margin-left: 14px;
color: #aaa;
}
.td_module_wrap .td-module-meta-info .td-post-views span {
margin-left: 5px;
}
Result: http://screencast.com/t/bxe0fSQep5
Thanks for the message!
Hi!
Please tell me where is the files
td_module_single_base.php and td_module.php?
/Newspaper/includes/wp_booster
Right?
And if I use a child theme, then after editing, these files should be located
/Newspaper-child/includes/wp_booster
-
This reply was modified 10 years by
Edward.
In what place of file td_module_single_base.php
function get_views() {
$buffy = '';
if (td_util::get_option('tds_p_show_views') != 'hide') {
$buffy .= '<div class="td-post-views">';
$buffy .= '<i class="td-icon-views"></i>';
// WP-Post Views Counter
if (function_exists('the_views')) {
$post_views = the_views(false);
$buffy .= $post_views;
}
// Default Theme Views Counter
else {
$buffy .= '<span class="td-nr-views-' . $this->post->ID . '">' . td_page_views::get_page_views($this->post->ID) .'</span>';
}
$buffy .= '</div>';
}
return $buffy;
}
should I insert in file td_module.php?
Hello,
You will need to copy the code from td_module_single_base.php and paste it in td_module.php and place it somewhere it does not affect other code, like for example here: http://screencast.com/t/CafGhKBymhz,
Then you need to edit td_module_8.php and add the line like in this screenshot: http://screencast.com/t/koCkDeey
<?php echo $this->get_views(); ?>
You can then use the css from above in the theme panel->custom css box for positioning.
I hope this helps!
Thanks.
Hello,
Please try to make these modifications to the main files so you can check to see if the modification worked as expected. And copy over the files in the child theme. Do a back-up of these files before you modify them. If the modification that works in the main file does not work from the child theme, then certain files will not be manageable from the child theme. I think the wp_booster files cannot be managed by the child theme.
Here is a list of files that can be used with the child theme: https://forum.tagdiv.com/the-child-theme-support-tutorial/
Thanks.
Hello,
We try to improve our theme on every update, including the child theme support as stated here: http://screencast.com/t/utFewXhfcm
As for the views i will add them to our list of updateds and hopefully in a future version we will be able to implement views on all blocks.
Thank you!
Hi,
A module is not the same as a block. The module is the base element and a block is simply a container for modules. Block 11 does not use module 11. You can see a list of what modules are used on what blocks here: http://screencast.com/t/95I3JzMoIZ
Please apply the modification in module 10 as this is the module used in block 11
Thank you!