Code embed with Gist not working
-
I normally just put the link to a Gist and WordPress will automatically embed it in my post. This no longer works. I have also tried using the short code:
[gist https://url /]
But that also does not work. I have a technical blog so embedding code is what it’s all about so the site is not really useful right now.
I have tried contacting you on this forum before with no response. I tried using your Twitter account. Any chance of getting some help on this issue?
Anyone else having this issue?
The blog I need help with is: (visible only to logged in users)
-
Hi there,
First, I noticed you have submitted multiple requests for support. To keep our conversation organized, I’m going to respond to your questions here and close the other requests. Please keep all further correspondence in this thread.
I was able to correctly embed a Gist within a WordPress.com blog using both methods mentioned here (shortcode and URL):
http://en.support.wordpress.com/gist/
Can you please make sure the URL within your post is not hyperlinked to the Gist?
Please let me know if you’re still having trouble!
-
Confirmed, it’s definitely not a link. You can look at this post, after the second paragraph (last sentence: Here’s a sample of a PowerShell For/Next loop) you’ll see a paragraph break and then the next paragraph. There should be an embedded Gist in there.
I’ve been using Gist’s for a couple of months now and they were working fine. Now suddenly they aren’t working.
-
Sorry, here’s the post: http://thesurlyadmin.com/2014/04/04/simple-multiplication-table/
-
Hi Martin!
I’m sorry you’re still having trouble. I was able to correctly embed the Gist here:
https://gist.github.com/2314628That comes from the support document example. However, I was not able to embed the Gist code you mention from your post. Can you check your settings in GitHub? Perhaps your Gists are set to private, preventing them from being embedded in your post.
-
Hi Jeremey,
OK, I think I’ve worked it out. When I originally tested your GIST (that I copied from the link from Gist, no less!) it didn’t work on yours either. Then I noticed your link didn’t have your user name in it, but the link from Gist did! I removed that and it displayed properly!
I went back to my article and removed my user name and now the links are working! This is odd because my older posts that *used* to work no longer do and I’ll have to remove the username from them–I’m assuming they all have it at this point.
I’ll update this thread after I re-edit everything *sigh*
-
Ok, here’s what I’m seeing.
If I use this link:
https://gist.github.com/Martin9700/9236607WordPress will embed the gist. But if I remove the username, it will:
https://gist.github.com/9236607If I just put the link in my browser with user name, it works fine. If I put the link in without the username it redirects to the site with the username.
Until the latest update, using the link with the username worked fine so clearly something has changed. Also, if I use the link provided by the gist page “link to this gist” that includes the username so I would think you’d want to update WordPress to be able to handle the username in there.
I’ve gone back through the 15-20 articles and removed the username from the link and they are all embedding properly now.
Obviously I’d like to see this fixed since I don’t want to have to remember to update the link every time I embed code. And anyone new to WordPress is going to have a problem if they follow the directions.
-
-
Hey Martin,
Thank you for experimenting and helping to troubleshoot! However, I was able to create a Gist and embed it on my site with the full URL (including username) as shown here:
I used the Inspect Element tool to highlight the URL that I embedded in my post. I confirmed that the username embed works regardless of whether the gist is secret or not.
So, I’m glad we were able to get this to work without your username, but I believe it should work with your username in the URL as well. Question: did you by any chance revoke Gist access to your GitHub account? Under ‘Authorized Applications’ here:
https://github.com/settings/applications
You should have Gist listed. That’s the only way I can reproduce what you’re experiencing.
-
Nope, it’s still there under Github applications. I’m wondering if it’s a problem with the theme, Andreas04?
-
OK, it’s not the theme. I have a test site as well:
http://thesurlyadmin.wordpress.com/
And it’s experiencing the same issue. If I put the username in there, no gist.
But take the user name away and I get it:
First tried with Andreas04 and now with Sorbet and same issue. Just to be thorough, here are my GitHub settings:
-
Hey Martin,
Can you try changing your GitHub username from Martin9700 to martin9700? It looks like the capital letter creates an invalid GitHub ID. You should then be able to embed gists with martin9700 in the URL.
Let me know if that has any effect!
-
Ok, that seems to be it! It’s working now. The invalid GitHub ID, was that coming from your systems or from GitHub? Just professional curiosity!
-
Hey Martin,
I’m not exactly sure. It looks like issues have come up in the past with uppercase letters in GitHub usernames as described here:
https://github.com/npm/npm/issues/1787
I believe this is an issue with GitHub, but I’m not positive. I’ll keep an eye out over the upcoming week and see if I can figure out more.
I’m just glad we got to the bottom of it. Weird issue for sure!
-
Well, I appreciate the help Jeremey! To be honest, it took awhile to get you, but once you were on you did a great job. Thanks for the help.
-
- The topic ‘Code embed with Gist not working’ is closed to new replies.
