0

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 (?).

notypist
  • 25
  • 5
  • I don't see how you can, as the button is in an iframe. Here is a fidddle for others who want a go. http://jsfiddle.net/e028gb4j/ – 2pha Aug 29 '14 at 11:28

1 Answers1

1

had the same problem. After a little search I used:

<a href="https://getpocket.com/edit.php?url=http://www.example.com/myPage.html">Save to Pocket</a>

You will be loosing the counter though. And of course a user must be logged in to Pocket to save immediately, if not he will be redirected to login page. This worked fine for me. Hope it does for you too.

panzergr
  • 21
  • 1