Visits & Views (Question)

Posted in: Newspaper
Post count: 285

Hi,
I want to ask you for same little help:
– for visits & views your theme use icons and right after that a corresponding number based on visits or comments.

I want to appear “Comments” and “Visits” after this numbers like in this image.

Thank you very much (even if I do not receive response because I know this is customization).
Regards,

Post count: 23312

Hello nairolf2013,

To do it, please notice that it is necessary to alter the code and add these strings. You will have to alter the code from td_module_single_base.php core file like this -> http://screencast.com/t/Zbdblc0JiQSx

The result you should see here -> http://screencast.com/t/JhQ9vSjU9

Thanks for your understanding!

Post count: 285

Hi Catalin,
Thank you, thank you and thank you very much.

Works like a charm. (last question: ¿I can add & n b s p ; in the beginning of the word “Visits” ? because seems that the number counter and the word they are glued.

like:

$buffy .= '<span class="td-nr-views-' . $this->post->ID . '">' . td_page_views::get_page_views($this->post->ID) . " Visits" . '</span>';

Again, thank you very much for your effort.

Post count: 285

Hi Catalin,
I found how comment the snippet to put one space for “Visits”, below is the code:
function get_comments() {
$buffy = '';
if (td_util::get_option('tds_p_show_comments') != 'hide') {
$buffy .= '<div class="td-post-comments">';
$buffy .= 'post->ID) . '"><i class="td-icon-comments"></i>';
$buffy .= get_comments_number($this->post->ID) . " " . "Comments";
$buffy .= '
';
$buffy .= '</div>';
}

return $buffy;
}

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) . " " . "Visits" .'</span>';
}

$buffy .= '</div>';
}
return $buffy;
}

but for some reason:

  • for comments works ok
  • for visits, after the page is loaded the string “Visits” disappears

Currently I’m using your solution only for the Comments.

P.D.: I don’t understand why is happening, in my local server works like a charm (both changes) but on real environment, nope. I have paid attention to cache and I don’t use third plugins.

Thank you.

Post count: 23312

Hello nairolf2013,

Please provide your website URL so I can inspect it closer because should not be any differences between local- host and live mode. Also, if your website is private one or if it is in maintenance mode, please send us an email at contact@tagdiv.com with your log-in information (wp-admin) so we can further inspect the problem.

Thanks for your understanding!

Post count: 285

Hi Catalin,
Thank you very much again.
Here you have for example a link (you’ll see how the string “visits” disappear after the page is loaded.

Thanks.

Post count: 23312

Hello nairolf2013,

Please ensure that you have right implemented the code because I have tried again on my side and everything seems to work as properly. Also, try to clear all your caches and check it again.

Thanks for your understanding!

Post count: 285

Hi Catalin,
You see any error in this implementation?
The line in question is 322 from td_module_single_base.php:
$buffy .= '<span class="td-nr-views-' . $this->post->ID . '">' . td_page_views::get_page_views($this->post->ID) . " " . "Visitas" .'</span>';

I talk with the host and they have no idea why the string “Visitas” disappear after 1 second when the page is loaded.

Post count: 23312

Hi,

Please try this implementation, like this -> http://screencast.com/t/PYxJRpUHvhtX If your problem is still there after this, please send us an email at contact@tagdiv.com with your log-in information (wp-admin) so we can further inspect your setup page. Also, please provide the full FTP access. Also, please provide the link of this topic so we can easily identify you.

Thanks.

Post count: 285

Hi Catalin,
I will provide the information (I tried with this new syntax but the same results).

Thanks

Viewing 10 posts - 1 through 10 (of 10 total)
The forum ‘Newspaper’ is closed to new topics and replies.