Unlike Instapaper, Pocket does not offer publishers a way to add an "Add to Pocket" text anchor.
This is the code I gather I should put in my index:
<a href="https://getpocket.com/save" class="pocket-btn" data-lang="en"
data-save-url="http://yourDomain.com/the/page/to/save.html"
data-pocket-count="vertical"
data-pocket-align="left"
>Pocket</a>
<script type="text/javascript">!function(d,i){if(!d.getElementById(i)){var j=d.createElement("script");j.id=i;j.src="https://widgets.getpocket.com/v1/j/btn.js?v=1";var w=d.getElementById(i);d.body.appendChild(j);}}(document,"pocket-btn-js");</script>
I'm using WordPress, so I'll have to replace the data-save-url
with PHP, that's not a problem. The problem is that I can't figure out how to make this element appear as Text and work properly. I've tried hiding its img
class and using span
and content:before/after
, but it doesn't work as the Javascript code is executing after the CSS has already loaded (?).