Create a PDF viewer shortcode

If you’re using PDF files on your WordPress blog, it could be very cool to give your users the chance to open them using Google Docs. The following recipe will show you how you can do that.

The first step is to paste the following code into your functions.php file:

function pdflink($attr, $content) {
	return '<a href="http://docs.google.com/viewer?url=' . $attr['href'] . '">'.$content.'</a>';
}
add_shortcode('pdf', 'pdflink');

Once you saved the file, you’ll be able to use the shortcode on your posts and page. Here is the syntax:

[pdf href="http://yoursite.com/linktoyour/file.pdf"]View PDF[/pdf]

If you enjoyed this article, please consider sharing it!

12 Comments

  1. viagra pillen 9 years ago

    Awesome blog over here! Thanks for sharing this very usefull information. I will visit your blog again into a couple off days to check if you have some new articles.

  2. Stefah 9 years ago

    You can certainly see your expertise in the paintings you write. The world hopes for even more passionate writers such as you who are not afraid to say how they believe. Always go after your heart.

    • Marni 9 years ago

      This is ecxatly what I was looking for. Thanks for writing!

  3. Sivalia 9 years ago

    I like this usefull information, for that reason I wanna thank you for posting it and I’ll follow your blog even more when you’ll keep up the good work!

  4. Shreves 9 years ago

    Just wish to say your article is as amazing. The clarity on your publish is simply nice and that i can suppose you are a professional on this subject. Well together with your permission let me to snatch your RSS feed to keep updated with approaching post. Thank you a million and please carry on the gratifying work.

    • Lakesha 9 years ago

      I really wish there were more artciels like this on the web.

  5. viga 9 years ago

    good day I just read your article and I wanna thank you for the awesome information in it! Please keep up the good work guys!

    • Hawk 9 years ago

      At last! Someone who unedrstands! Thanks for posting!

  6. Micle 9 years ago

    Great website. A lot of useful information here. I am sending it to several pals ans also sharing in delicious. And of course, thanks on your effort!

  7. Dunsmoor 9 years ago

    Whats up very nice site!! Man .. Excellent .. Wonderful .. I’ll bookmark your blog and take the feeds also?I am happy to seek out numerous useful info here within the put up, we want develop more strategies in this regard, thanks for sharing. . . . . .

  8. Berna Kilger 9 years ago

    Have you ever thought about including somewhat bit extra than just your ideas? I imply, what you say is important and everything. However its obtained no punch, no pop! Maybe if you added a pic or two, a video? You could possibly have such a extra highly effective weblog for those who let people SEE what youre speaking about as a substitute of just studying it. Anyway, in my language, there usually are not much good supply like this.

  9. Isabella 9 years ago

    All of these artilces have saved me a lot of headaches.

  10. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Nicely put. Thanks.

    viagra no presrciption phentermine viagra
    cheap viagra
    drug herb interaction vimax viagra – https://genericviagrantx.com

    KeithSnots
    Richardprimi
    Ernestovab

  11. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Superb info. Cheers!

    viagra ruined sex life viagra discrimination
    generic viagra 100mg
    couples that take viagra – https://genericviagramsl.com

    KeithSnots
    Richardprimi
    Ernestovab

  12. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Nicely put. Thank you.

    penis pump better than viagra penegra generic viagra silagra penegra cumwithuscom
    buy viagra online
    viagra fan club discussion board – https://genericviagramsl.com

    KeithSnots
    Richardprimi
    Ernestovab

  13. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Thank you, I enjoy it.

    a href viagra cialis levitra a active ingredient of viagra
    buy generic viagra
    what age to start using viagra – https://genericviagrantx.com

    KeithSnots
    Richardprimi
    Ernestovab

  14. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    You actually said that exceptionally well.

    take viagra with amlodipine canadian viagra
    viagra pills
    buy generic viagra usa – https://genericviagrantx.com

    KeithSnots
    Richardprimi
    Ernestovab

  15. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Useful info. Thanks!

    viagra help women viagra pill on line
    viagra 100mg
    female uk viagra – https://genericviagrantx.com

    KeithSnots
    Richardprimi
    Ernestovab

  16. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    This is nicely put! !

    how to buy viagra low cost viagra
    generic viagra 100mg
    review cialis levitra viagra – https://genericviagrantx.com

    KeithSnots
    Richardprimi
    Ernestovab

  17. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    You definitely made the point.

    ketamine viagra viagra tablet size
    viagra generic
    viagra testamonials – https://genericviagrarcp.com

    KeithSnots
    Richardprimi
    Ernestovab

  18. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    You said it nicely..

    viagra heart medication safe to take viagra with phentermine
    generic viagra online
    find viagra edinburgh sites search posted – https://genericviagrantx.com

    KeithSnots
    Richardprimi
    Ernestovab

  19. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Many thanks. Useful information.

    viagra from us sellers can someone on amiloride take viagra
    viagra 100mg
    viagra ordering – https://genericviagrantx.com

    KeithSnots
    Richardprimi
    Ernestovab

  20. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    You made your point!

    viagra or 100mg costa rica tico paradise viagra
    viagra generic
    does viagra delay orgasms – https://genericviagrarcp.com

    KeithSnots
    Richardprimi
    Ernestovab

  21. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    You actually reported this fantastically!

    discount sildenafil generic viagra chewable viagra
    buy viagra
    $2.00 calias viagra – https://genericviagrarcp.com

    KeithSnots
    Richardprimi
    Ernestovab

  22. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Well expressed really! !

    song on the new viagra commercial canadian company selling viagra
    viagra pills
    viagra and watermellon – https://genericviagramsl.com

    KeithSnots
    Richardprimi
    Ernestovab

  23. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    You mentioned this superbly.

    jalepeno and viagra college website and hacked and viagra
    viagra 100mg
    non generic viagra – https://genericviagrantx.com

    KeithSnots
    Richardprimi
    Ernestovab

  24. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    You actually said that well.

    pornstars take viagra foods that act like viagra
    generic viagra online
    levitra viagra cialis best – https://genericviagrantx.com

    KeithSnots
    Richardprimi
    Ernestovab

  25. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Amazing plenty of terrific material!

    lowest viagra price dick on viagra
    viagra online
    viagra nitrolingual – https://genericviagramsl.com

    KeithSnots
    Richardprimi
    Ernestovab

  26. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Point certainly considered!.

    soft viagra tablets united states discount viagra
    viagra 100mg
    viagra quick prescription generic – https://genericviagramsl.com

    KeithSnots
    Richardprimi
    Ernestovab

  27. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Thanks a lot, A lot of posts.

    online viagra prescription can viagra affect your heart
    viagra 100mg
    how to order viagra over internet – https://genericviagrantx.com

    KeithSnots
    Richardprimi
    Ernestovab

  28. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    You made the point!

    free fonts viagra viagra max coplaints
    cheap viagra
    canadian mail order viagra – https://genericviagramsl.com

    KeithSnots
    Richardprimi
    Ernestovab

  29. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Great information. Kudos.

    cialis and viagra tgether online viagra prescription
    generic viagra 100mg
    ejaculation viagra – https://genericviagrarcp.com

    KeithSnots
    Richardprimi
    Ernestovab

  30. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Wow loads of fantastic information!

    viagra in mexico womens viagra
    generic viagra
    viagra lavitra cialis – https://genericviagramsl.com

    KeithSnots
    Richardprimi
    Ernestovab

  31. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    You expressed it effectively!

    boys viagra whats the active ingrediant for viagra
    viagra for women
    humor viagra commercial theater elevator – https://genericviagrantx.com

    KeithSnots
    Richardprimi
    Ernestovab

  32. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Seriously tons of useful knowledge.

    pharmacy on line viagra health information on viagra
    viagra pills
    viva viagra ring tone – https://genericviagrarcp.com

    KeithSnots
    Richardprimi
    Ernestovab

  33. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Thanks a lot. Terrific information.

    arti viagra fake emails linking to viagra
    generic viagra 100mg
    viagra in ironman – https://genericviagrarcp.com

    KeithSnots
    Richardprimi
    Ernestovab

  34. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Regards! I value this!

    generic viagra blue pill products related to viagra
    viagra online
    using viagra for canines – https://genericviagrarcp.com

    KeithSnots
    Richardprimi
    Ernestovab

  35. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Information clearly considered.!

    viagra alternative and woman buy viagra online no script
    viagra generic
    viagra sublinqual – https://genericviagrarcp.com

    KeithSnots
    Richardprimi
    Ernestovab

  36. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Nicely put. Many thanks.

    viagra 25 where can i buy viagra
    buy generic viagra
    viagra and parkinsons – https://genericviagrarcp.com

    KeithSnots
    Richardprimi
    Ernestovab

  37. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Wow a lot of awesome facts!

    viagra diaries radio 10 23 09 viagra next day shipment
    viagra generic
    when was viagra discovered – https://genericviagrarcp.com

    KeithSnots
    Richardprimi
    Ernestovab

  38. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Fantastic facts. Many thanks.

    cheap order viagra natural substitutes for viagra
    viagra online
    viagra ordering phone number – https://genericviagramsl.com

    KeithSnots
    Richardprimi
    Ernestovab

  39. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Whoa a good deal of great data!

    nhs and viagra viagra online doma
    buy viagra online
    viagra embarrasing stories – https://genericviagrantx.com

    KeithSnots
    Richardprimi
    Ernestovab

  40. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Thank you. Loads of knowledge!

    viagra natural viagra find sites computer
    viagra for sale uk
    viagra buy on line – https://genericviagramsl.com

    KeithSnots
    Richardprimi
    Ernestovab

  41. Ernestovab 10 months ago
    Your comment is awaiting moderation.
  42. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Thank you! A good amount of postings!

    viagra mixers viagra ingredients release
    viagra online
    global systems viagra – https://genericviagramsl.com

    KeithSnots
    Richardprimi
    Ernestovab

  43. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Amazing stuff, Many thanks!

    viagra pricing cfids viagra
    viagra pills
    viagra tylenol test – https://genericviagrantx.com

    KeithSnots
    Richardprimi
    Ernestovab

  44. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Nicely put. Thanks.

    viagra cialis online viagra gone wrong funny pic
    buy viagra
    viagra and high blood pressure – https://genericviagramsl.com

    KeithSnots
    Richardprimi
    Ernestovab

  45. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Seriously lots of useful material.

    viagra available in beijing lowest price generic viagra
    buy viagra online
    generic viagra compare cialis pills – https://genericviagrarcp.com

    KeithSnots
    Richardprimi
    Ernestovab

  46. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Wonderful info. Thank you!

    viagra free sites find search pages antibiotics viagra
    viagra pills
    gay viagra stories – https://genericviagrarcp.com

    KeithSnots
    Richardprimi
    Ernestovab

  47. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Perfectly expressed really! .

    soft tabs generic viagra viagra ice cream
    viagra online
    viagra free sites computer find href – https://genericviagrarcp.com

    KeithSnots
    Richardprimi
    Ernestovab

  48. Ernestovab 10 months ago
    Your comment is awaiting moderation.
  49. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Kudos. A lot of forum posts.

    effectiveness viagra levitra cialis viagra headquarters picture
    buy viagra online
    does viagra affect blood pressure – https://genericviagrarcp.com

    KeithSnots
    Richardprimi
    Ernestovab

  50. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Beneficial knowledge. Regards.

    shop for viagra viagra pulse rate
    viagra for women
    mixing viagra with cialias – https://genericviagramsl.com

    KeithSnots
    Richardprimi
    Ernestovab

  51. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Excellent knowledge. Appreciate it.

    viagra nutritional supplements injecting viagra
    viagra for women
    dangers of viagra mayo clinic – https://genericviagrantx.com

    KeithSnots
    Richardprimi
    Ernestovab

  52. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    You actually expressed that really well.

    drug online viagra wanted too buy viagra
    viagra online
    cost of viagra in canada – https://genericviagrantx.com

    KeithSnots
    Richardprimi
    Ernestovab

  53. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    You actually explained this really well.

    buy viagra online order is generic viagra avaible in india
    viagra online
    viagra and buy – https://genericviagrarcp.com

    KeithSnots
    Richardprimi
    Ernestovab

  54. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Very good postings. Cheers.

    viagra exp date damaged by viagra
    viagra for sale uk
    viagra lung problems – https://genericviagrantx.com

    KeithSnots
    Richardprimi
    Ernestovab

  55. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Thank you, Good stuff.

    online viagra review viagra cialis celerity
    viagra generic
    viagra generic brand – https://genericviagramsl.com

    KeithSnots
    Richardprimi
    Ernestovab

  56. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    You actually explained this really well!

    sub for viagra force feed viagra
    viagra without a doctors prescription
    viagra erection photos – https://genericviagrarcp.com

    KeithSnots
    Richardprimi
    Ernestovab

  57. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Really quite a lot of wonderful knowledge.

    viagra phosphodiesterase generic viagra 24 hours
    viagra 100mg
    edinburgh find search free viagra sites – https://genericviagrantx.com

    KeithSnots
    Richardprimi
    Ernestovab

  58. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Lovely material, Appreciate it.

    smooth muscle piperazine viagra viagra or levitra which is better
    generic viagra
    viagra hearing problems – https://genericviagrarcp.com

    KeithSnots
    Richardprimi
    Ernestovab

  59. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    With thanks. A good amount of postings.

    kid wins teddybear with viagra shirt natural supplements work like viagra
    generic viagra 100mg
    safe dose of viagra – https://genericviagrarcp.com

    KeithSnots
    Richardprimi
    Ernestovab

  60. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Nicely put. With thanks!

    viagra beer off label use viagra
    viagra for women
    best places to buy viagra – https://genericviagrantx.com

    KeithSnots
    Richardprimi
    Ernestovab

  61. Ernestovab 10 months ago
    Your comment is awaiting moderation.

    Fine tips. Regards!

    slogans for viagra before and after photos using viagra
    viagra without a doctors prescription
    can caverject be used with viagra – https://genericviagramsl.com

    KeithSnots
    Richardprimi
    Ernestovab

Leave a reply

Your email address will not be published. Required fields are marked *

*