Recently, I have started to transfer my articles from Medium to my personal website. As my articles contains Github Gists, I first tried to embed github gists into my WordPress 6.0 blog. But, ironically, I found that the current version of the WordPress fails to embed gists.
Use Gist Embedding Plugins
Therefore, I have first tried to use third-party addons to fix the problem. I have tried all the addons that advertises themselves as having the gist embedding feature. But, the ones I have tried did not worked either.
- Page Builder Gutenberg Blocks – CoBlock
- [Failed to embed Github Gist]
Embed Gist into HTML
Then, I have tried to embed the Github Gist by embedding it into the html using html script. With this one, the article editor preview of the HTML successfully showed the gist. But, when I published the article, it failed to display the gist.
Use Gist Alternatives to Embed Source Code
The third solution I have come up with was to embed source code using other third-party websites rather than using Github Gists. I have tried pastebin, reply.it and some other ones but none of them worked.
Use Elementor Source Code Highlighting Feature
The forth solution was to try to use Elementor. Even though Elementor solution works, it requires premium account. Apart from the Premium Elementor lisance cost, Elementor is a huge addon. As I would rather not to use big addons in my simple blog, I have skipped this solution.
Use Third-Party Source Code Highlighting Addons
Lastly, I started to search third party source code highlighting addons. Then, I have found source code highlighting addons that worked well, even though not as perfect as Github Gists. I will stick to use code highlighting addons until the problems with WordPress gist embedding get resolved.
Here you can find a set of alternative third party source code highlighting addons available for wordpress.