pierre1688
Forum Replies Created
-
Dear Micropat,
According to Facebook share count seems not to work properly. I don’t know why! It was normal yesterday. So far, share counts always become zero. Even, I clicked Facebook button to share. Do you know what happened?And another thing, I attempt to change JS code as below, will it work properly? Thanks.
var oldUrl = "<?php echo get_permalink(); ?>"; var a2a_config = a2a_config || {}; a2a_config.counts = { recover: oldUrl };
Forum: Fixing WordPress
In reply to: How to add date data attributes into the theme’s body tag?Dear bcworkz,
Thanks for your great suggestion.
I will attempt to resolve this issue with your mentioned.
Thanks again!Dear Micropat,
Sorry for any confused!
The “test.idv.tw” this domain name is dummy. The real is happypanda.idv.tw. It is only for experiment. Not for public.All procedures are with below linking just for your reference!
It is still failure. Please help to check again! Thanks a million.Forum: Fixing WordPress
In reply to: How to add date data attributes into the theme’s body tag?Dear Joy,
Sorry for any inconvenience!
I am new for WordPress with my website established. And sorry my poor English.
Because I don’t have any directions to resolve my issue. Even I searched a lot articles from Google. So I just created this topic in this forum. Finally, thanks for replying.Dear bcworkz,
I am using AddtoAny this plugin to do social share. Currently, there are some share counts in my website. But, I had a mistake to select inappropriate URL. So, the share counts will be zero after changed the new URL’s structure. From AddtoAny’s author replied, it can recovery the share counts with some JS code. But the website needs to provide date date in the theme’s HTML code. It is why I posted this topic in here.
Thanks for your any comments. I will investigate it again!Dear Micropat,
I had already added date data into my theme’s HTML code as below linking reference.
And with below code, but it still can’t recover share counts properly after changed URL’s structure. Is there something wrong with that? Please help to investigate again!code:
a2a_config.counts = {
// Recover old URL structure
recover: function(data) {
var kitData = document.body.dataset;if (kitData && kitData.year && kitData.month && kitData.day ) {
return ‘https://test.idv.tw/’
+ kitData.year +’/’
+ kitData.month +’/’
+ kitData.day +’/’
+ data.pathParts[data.pathParts.length – 1] + ‘/’;
}
}
};Dear Micropat,
Thanks for your detailed explanation and tips. I will attempt to resolve this and reach my goals. Thanks again!Forum: Plugins
In reply to: [AddToAny Share Buttons] Can’t recover share count with another URL structureDear Micropat,
Sorry for any inconvenience again!
I am still researching this. So far, I tried below way to resolve this issue. Unfortunately, it failed. This was I experimented.Step1: Added “custom field” into the post with Key/Value.
Step2: Added three sets of K/V,For example:
Key:data-year Value:2017 / Key:data-month Value:10 / Key:data-day Value:20Could please you give me any directions to resolve it? And I still can’t understand what meaning with [document.body.dataset] this line?
Can you share any document or linking to understand below code true meaning?
Please advise! Thanks a million.code:
a2a_config.counts = {
// Recover old URL structurerecover: function(data) {
var kitData = document.body.dataset;
// If the AddToAny instance has “data-” attributes in the HTML like:
// <div class=”a2a_kit” data-year=”2020″ data-month=”01″ data-post-id=”123″>
if (kitData && kitData.year && kitData.month && kitData.day) {
// Arrange the pathname parts of the old URL like:
// https://old.example.com/2020/01/123/post-name/
return ‘https://test.idv.tw/’
+ kitData.year + ‘/’
+ kitData.month + ‘/’
?+ kitData.day + ‘/’
+ data.pathParts[data.pathParts.length – 1] + ‘/’;
}
}};
Forum: Plugins
In reply to: [AddToAny Share Buttons] Can’t recover share count with another URL structureDear Micropat,
Thanks for replying this mail.
I am new for WordPress environment with my website. So I don’t have any ideas to add it into my theme’s HTML code.
And what difference are they with [document.body.dataset] and [data.kit.dataset]?
And what does it mean with below line?
var a2a_config = a2a_config || {};
Because it seems not to appear in your suggestion code.Will you help me again for those basic knowledge technology for this question?
Thanks again!