External Follow Button
-
In 5.8, widgets no longer update when the html code for the WordPress.com ‘External Follow Button’ is in a custom HTML block in your widgets. If you remove the script tag, Widgets saves (Updates) just fine.
Site: https://mudkingdom.com.
WP.com: Unknown
Jetpack: Yes
Correct account: Yes -
Hello there,
Can you tell us more about the script being added into the widget please?
The reason being is that this doesn’t like normal behaviour.
Many thanks.
-
<p><a class="wordpress-follow-button" href="https://mudkingdom.com" data-blog="https://mudkingdom.com" data-lang="en">Follow The Mud Kingdom on WordPress.com</a><script type="text/javascript">(function(d){var f = d.getElementsByTagName('SCRIPT')[0], p = d.createElement('SCRIPT');p.type = 'text/javascript';p.async = true;p.src = '//widgets.wp.com/platform.js';f.parentNode.insertBefore(p,f);}(document));</script></p>https://drive.google.com/file/d/1WRMCmaEYCK2pucCfEy3uHUo4ui-9TV7A/view?usp=sharing
-
FYI: If I remove the script tag from the above code in the Custom HTML block widget, the widgets will update just fine.
-
Hello there,
Which site are you adding this script to exactly?
The reason why I ask is because this script wouldn’t be possible outside of the Business plan.
Many thanks.
-
I am and have been using this script on a privately hosted wordpress.org site and it’s been fine. The problem is when I want, in WordPress 5.8, to update my widgets.
-
Hello there,
I can’t see that this is a sit with WordPress.com, so our support is limited.
My advice would be to make sure all themes and plugins are up to date. Failing that, you would need to deactivate all plugins and reactivate them one by one to see if there’s a plugin conflict happening.
I hope this helps.
-
Yup, I’m posting here because the wordpress.org engineers suggested that I do so to alert you that your external follow button was causing an issue (I don’t think there’s anything wrong with the external follow button script).
I’ve deactivated all plugins and used the Twenty Twenty theme and the 5.8 widgets still won’t save with the code in the custom html block in the widgets.
I’m pretty sure this is a core wordpress problem.
-
-
Chrome.
I don’t have an issue getting the button to “show.” The trouble is trying to update my Widgets after adding the code to the custom html block in Widgets.
https://drive.google.com/file/d/1WRMCmaEYCK2pucCfEy3uHUo4ui-9TV7A/view?usp=sharing
-
Hi there,
I noticed that the code you gave in this response above looks a bit unusual. Specifically it has some extra
<p>tags that are not present if I generate a fresh code at: https://developer.wordpress.com/docs/follow-button-creation/I was not able to get your code snippet to work correctly but I generated a fresh follow button code, and that is working well for me. Can you try this code and let us know if it works for you too? Thanks!
<a class="wordpress-follow-button" href="https://mudkingdom.com" data-blog="https://mudkingdom.com" data-lang="en">Follow The Mud Kingdom on WordPress.com</a> <script type="text/javascript">(function(d){var f = d.getElementsByTagName('SCRIPT')[0], p = d.createElement('SCRIPT');p.type = 'text/javascript';p.async = true;p.src = '//widgets.wp.com/platform.js';f.parentNode.insertBefore(p,f);}(document));</script> -
The p tags are added by the block but the results are the same if they are removed. The issue is the script tag prevents 5.8 from updating my widgets. If I remove the script tag, the widgets update just fine.
-
Thanks for confirming. I can confirm I see them added as well, now that I refresh the widgets manager page. I did also see what I think might be another error in the code (which is converted to a
<br>tag, which should not be in there) so I have removed it and for me this code is working.<a class="wordpress-follow-button" href="https://mudkingdom.com" data-blog="https://mudkingdom.com" data-lang="en">Follow The Mud Kingdom on WordPress.com</a><script type="text/javascript">(function(d){var f = d.getElementsByTagName('SCRIPT')[0], p = d.createElement('SCRIPT');p.type = 'text/javascript';p.async = true;p.src = '//widgets.wp.com/platform.js';f.parentNode.insertBefore(p,f);}(document));</script>If you give that a try are you able to save it? On my self-hosted test site (also on v5.8) this code works well for me so I’m not sure it’s an issue with the version of WordPress you are using in this case.
Thanks for the additional info!
-
Hi again @davidylin04
I reviewed your thread and I noticed you mentioned posting in the .org forums originally? Can you share a link to your posting there so we can refer to the troubleshooting steps that have already been tried? Thanks!
-
Also: I’ve tried putting in the fresh generated code, and removing the p and br tags don’t really affect my issue. I’m considering spinning up another 5.8 server fresh just to see if it will have the same problems.
-
Also: I’ve tried putting in the fresh generated code, and removing the p and br tags don’t really affect my issue. I’m considering spinning up another 5.8 server fresh just to see if it will have the same problems.
-
OK – THIS GETS EVEN STRANGER
This will error on Updating Widgets:
<a class="wordpress-follow-button" href="https://mudkingdom.com" data-blog="https://mudkingdom.com" data-lang="en">Follow The Mud Kingdom on WordPress.com</a><script type="text/javascript">(function(d){var f = d.getElementsByTagName('SCRIPT')[0], p = d.createElement('SCRIPT');p.type = 'text/javascript';p.async = true;p.src = '//widgets.wp.com/platform.js';f.parentNode.insertBefore(p,f);}(document));</script>But this will work when you go to Update Widgets:
<a class="wordpress-follow-button" href="https://mudkingdom.com" data-blog="https://mudkingdom.com" data-lang="en">Follow The Mud Kingdom on WordPress.com</a><script type="text/javascript"> (function (d) { var f = d.getElementsByTagName("SCRIPT")[0], p = d.createElement("SCRIPT"); p.type = "text/javascript"; p.async = true; p.src = "//widgets.wp.com/platform.js"; f.parentNode.insertBefore(p, f); })(document);</script>They’re literally the same thing, but with some line breaks thrown in. VERY ODD BEHAVIOR
-
Hello there,
I’m considering spinning up another 5.8 server fresh just to see if it will have the same problems.
It would be good to run this experiment to see what happens, and we’d be interested in seeing the results of that.
They’re literally the same thing, but with some line breaks thrown in. VERY ODD BEHAVIOR
Very odd indeed! To confirm was this code definitely generated from https://developer.wordpress.com/docs/follow-button-creation/ ?
- The topic ‘External Follow Button’ is closed to new replies.