Good morning Calin,
first off, thank you for your quick answer.
In the first example is true that post and image has the same name but the urls within wordpress are different isn’t it?
– Post: https://www.glutenfreeadventures.net/restaurantes-sin-gluten-en-plovdiv-2/
– Image: https://www.glutenfreeadventures.net/wp-content/uploads/2020/03/restaurantes-sin-gluten-en-plovdiv-2.jpg
In the second example, the image that Google displays has not the same name than the post, like the url where Google takes us, which is a combination of the post in the english version of my website, the name of the post in english, and the name of the image:
– Post name: Restaurantes sin gluten en Sofia
– Post url: https://www.glutenfreeadventures.net/restaurantes-sin-gluten-en-plovdiv-2/
– Image name: terraza restaurante sin gluten soul kitchen sofia bulgaria
– Image url: https://www.glutenfreeadventures.net/wp-content/uploads/2020/03/terraza-restaurante-sin-gluten-soul-kitchen-sofia-bulgaria.jpg
– URl given by Google: https://www.glutenfreeadventures.net/en/gluten-free-restaurants-in-sofia-1/terraza-restaurante-sin-gluten-soul-kitchen-sofia-bulgaria-2/
Before changing all images on the website, I would like to know if having the image name like the post is not compatible, and where this url comes from: https://www.glutenfreeadventures.net/en/gluten-free-restaurants-in-sofia-1/terraza-restaurante-sin-gluten-soul-kitchen-sofia-bulgaria-2/
thank you in advance for your support,
This is the last post where I had the usual number of “views”:
– Spanish: http://www.glutenfreeadventures.net/restaurantes-sin-gluten-en-gante/
– English: http://www.glutenfreeadventures.net/en/gluten-free-restaurants-in-ghent/
As you will see, in the Spanish version I have 1664 views and in the English version 204.
The post in both languages was published at the same time
Thank you for your quick reply simchris!
Do you mean that all “views” I had until three weeks ago were fake?
My website is in English and Spanish, and in Spanish I was having an average of 1500-2000 “views” and in English “90-150”. Do “bad bots” only affected the Spanish Language?
When did you installed the Fail2Ban? I just have this “problem” since three weeks.
Thank you in advance,
Hi Chris S,
You were right with the custom field “webnus_views” but I didn’t succeed on editing the php file you indicated in the first answer.
In any case, your last answer was the key to solve the problem!
thanks a lot for your patience and good help! Really appreciate it!
Dear Catalin,
First of all, thanks for your quick answer.
I checked the instructions you gave to “jules” in the link you shared, but the problem is that I do not have the String Translation section (https://www.screencast.com/t/bNJ4SwKe).
Besides, I cannot change this option: https://www.screencast.com/t/KuG8bKLil
Is there any other way to make this translation?
Thanks in advance,
Dear Chris,
I kindly ask you to give me more indications of what should I look for in the post editor and how to do it. This is my first website and I am not familiar with the technical details you ask me to look for.
Thanks in advance
Solved! Thanks a lot for your help Simion C.
Dear Chris,
I tried to substitute “post_views_count” in the sentence of the code you indicated me in your first reply by ‘websnus_views’ but didn’t work. I also tried to do it with ‘views’, ‘Views’, ‘hits’ and some other and didn’t work either.
I took the last post published with the Papillon templete and checked the code: view-source:http://www.glutenfreeadventures.net/es/restaurantes-sin-gluten-en-tel-aviv-israel-segunda-parte/
I looked for the sentence STATIC $POST_VIEW_COUNTER_KEY and it does not appear anywhere.
I do not know exactly what word should I look for in the page code in order to identify what is the wording to be changed to recover the views counter that I had with the old templete… could you help me on that please?
Another question I have is that if after recovering the old count (for example, having 900 visits in the last post) someone visits this post again, will this continue counting from this point on, showing 901?
Thanks in advance for your help,
Thanks for your quick answer Chris S.
Below I share what I found from the “functions.php” of Papillon templete. I do not know which is the one I should change in the:
STATIC $POST_VIEW_COUNTER_KEY = ‘VIEWS’;
If I change this, and someone visit the post, will it continue counting adding visits to the post?
Below whay I found related with post views:
a)
$post_views = getViews(get_the_ID());
b)
<i class=”fa-clock-o”></i> <span>’ . $post_time . ‘</span> <i class=”fa-eye”></i> <span>’. $post_views.'</span> <i class=”fa-comment-o”></i> <span>’ . $post_comments . ‘</span>
c)
function setViews($postID) {
$count_key = ‘webnus_views’;
$count = get_post_meta($postID, $count_key, true);
if($count==”){
$count = 0;
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, ‘0’);
}else{
$count++;
update_post_meta($postID, $count_key, $count);
}
return $count; /* so you can show it */
}
function getViews($postID) {
$count_key = ‘webnus_views’;
$count = get_post_meta($postID, $count_key, true);
if($count==”){
$count = 0;
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, ‘0’);
}
return $count; /* so you can show it */
}
Thanks in advance for your help! I am not familiar with web coding… I create it with visual composer because I do not know how to code.