Thanks for pointing out the bug in the theme.
There are some code additions in some files for making the popular post widget to work.
1. single.php file
You need to add this line of code:
<?php foodicious_setCTcounterViews(get_the_ID()); ?>
just before this line: <div <?php post_class(‘post’); ?>>
2. functions.php file
You need to add a function for counting views by adding the below given block of code in the functions.php file:
function foodicious_setCTcounterViews($postID) {
$views_key = ‘post_views_count’;
$count = get_post_meta($postID, $views_key, true);
if($count==”){
$count = 0;
delete_post_meta($postID, $views_key);
add_post_meta($postID, $views_key, ‘0’);
}else{
$count++;
update_post_meta($postID, $views_key, $count);
}
}
You can add this function just after this line of code: remove_action( ‘wp_head’, ‘adjacent_posts_rel_link_wp_head’, 10, 0);
We’ve also updated the theme to the latest version. You can download the theme files and use them.
-
This reply was modified 3 years, 11 months ago by
VineThemes.