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. LarryReoft 10 months ago
    Your comment is awaiting moderation.

    You actually mentioned that effectively.

    is half a viagra effective effects from side viagra
    viagra without a doctors prescription
    sites computer viagra edinburgh find report – https://genericviagrarcp.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

  11. LarryReoft 10 months ago
    Your comment is awaiting moderation.
  12. LarryReoft 10 months ago
    Your comment is awaiting moderation.
  13. LarryReoft 10 months ago
    Your comment is awaiting moderation.

    You actually revealed this exceptionally well!

    viagra board viagra special delivery uk
    viagra online
    walmart generic viagra – https://genericviagrantx.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Thanks a lot, Ample forum posts.

    viagra alternatives and blog girl viagra
    viagra online
    generic viagra year – https://genericviagrarcp.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    You explained this exceptionally well!

    viagra be very afraid greeting card viagra for wemen
    generic viagra 100mg
    generic viagra free shipping – https://genericviagrarcp.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

  16. LarryReoft 10 months ago
    Your comment is awaiting moderation.
  17. LarryReoft 10 months ago
    Your comment is awaiting moderation.

    You mentioned it terrifically.

    buy viagra on the internet generic viagra silagra cumwithuscom
    viagra for sale uk
    when viagra doesn’t work any more – https://genericviagramsl.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Incredible a lot of good knowledge!

    viagra perscriptions viagra without prescription
    generic viagra online
    gay men viagra – https://genericviagramsl.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Amazing advice. Regards.

    viagra product information cialis europe cheap viagra
    generic viagra online
    key acheter viagra en ligne – https://genericviagrantx.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Very good tips. Appreciate it.

    viagra and sports viagra impotence
    generic viagra
    viagra levitra drug comparison – https://genericviagrantx.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Many thanks! Lots of posts!

    viagra and ejaculations get viagra free sample
    viagra for sale uk
    viagra coupon – https://genericviagrarcp.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    You mentioned that terrifically.

    lowest price viagra america sample viagra
    viagra 100mg
    which is best viagra or cialis – https://genericviagrarcp.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Kudos! Ample tips.

    interaction viagra cialis obtain a prescription for viagra
    buy generic viagra
    genuine pfizer viagra – https://genericviagrantx.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Reliable data. With thanks!

    wife sold ski doo viagra 3 caverta veega generic viagra
    viagra generic
    buy generic viagra off the shelf – https://genericviagrarcp.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Wonderful facts, Thank you!

    dicks on viagra hemorrhoids viagra
    viagra without a doctors prescription
    generic viagra online uk – https://genericviagrantx.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Incredible quite a lot of terrific facts!

    viagra cialis health erection penis man medicine viagra
    viagra generic
    cialis uprima viagra – https://genericviagramsl.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Wow all kinds of fantastic data!

    powered by drupal node viagra viagra quick delivery
    viagra pills
    hacker viagra – https://genericviagrarcp.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    This is nicely put. !

    what’s better cialis or viagra obtain a prescription for viagra
    viagra online
    rush arrested with viagra – https://genericviagrarcp.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Incredible tons of useful tips!

    viagra is made with premature ejaculation viagra
    viagra without a doctors prescription
    viagra relaxes spinkter – https://genericviagrantx.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Thanks a lot, Loads of knowledge!

    free viagra sample viagra patient information
    buy generic viagra
    dose of viagra – https://genericviagrarcp.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

  31. LarryReoft 10 months ago
    Your comment is awaiting moderation.
  32. LarryReoft 10 months ago
    Your comment is awaiting moderation.

    Thanks! I enjoy it.

    natural foods that act like viagra viagra and loss of vision
    viagra 100mg
    generic viagra online uk – https://genericviagramsl.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Thanks. Fantastic information.

    viagra online fedex viagra how to use
    viagra pills
    viagra round brown pill – https://genericviagrantx.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Cheers. I value this.

    viagra high bloodpressure viagra prolonged erection
    viagra generic
    can viagra be broken in half – https://genericviagramsl.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Regards. Plenty of information.

    viagra generic soft tab herbal viagra walgreens
    generic viagra 100mg
    generic viagra compared – https://genericviagrantx.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Cheers, An abundance of info.

    viagra strength viagra versus lavitra
    viagra 100mg
    pictures of erect penises on viagra – https://genericviagrarcp.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Whoa a good deal of good information.

    viagra cialis from canada what color is viagra
    generic viagra 100mg
    file viewtopic t 21508 viagra – https://genericviagrarcp.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    You reported this effectively.

    natural viagra formulas cost of viagra at walgreens
    generic viagra 100mg
    viagra best results pharmacy – https://genericviagrantx.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    With thanks, I like this!

    generic viagra free shipping cars in viagra commercial
    generic viagra 100mg
    cb viagra kit – https://genericviagramsl.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    This is nicely expressed! .

    weight control and viagra uk viagra in the water karaoke
    generic viagra
    cailis vs viagra – https://genericviagramsl.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

  41. LarryReoft 10 months ago
    Your comment is awaiting moderation.

    Fantastic stuff. Thanks a lot!

    call appointment doctor viagra does viagra give you a hardon
    buy viagra online
    viagra vison loss – https://genericviagrarcp.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

  42. LarryReoft 10 months ago
    Your comment is awaiting moderation.

    Kudos, A good amount of advice.

    viagra audio torrent viagra without a presciption
    viagra generic
    viagra nasal spray – https://genericviagrantx.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Regards. An abundance of facts.

    viagra no prescription overnite shipping viagra impotence
    generic viagra 100mg
    female viagra chocolets – https://genericviagramsl.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Kudos, Ample info!

    drug female viagra viagra effects photos porn
    viagra for sale uk
    whats best viagra cialis – https://genericviagramsl.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Nicely put. Thanks a lot!

    keywords cialis levitra sales viagra viagra in my bones
    buy viagra online
    viagra pr cautions d’emploi – https://genericviagrarcp.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Wonderful facts. Thanks a lot.

    subaction showcomments viagra thanks newest pornstars on viagra
    viagra generic
    viagra and hair growth – https://genericviagramsl.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Amazing information, Kudos.

    viagra 100 mg price buy viagra online
    viagra pills
    viagra cartooms – https://genericviagrantx.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

  48. LarryReoft 10 months ago
    Your comment is awaiting moderation.

    Nicely expressed indeed. .

    buy generic viagra on line viagra hardon
    buy viagra online
    edinburgh uk viagra find sites search – https://genericviagramsl.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

  49. LarryReoft 10 months ago
    Your comment is awaiting moderation.

    Many thanks! Great stuff!

    viagra erection time drugs that interfere with viagra
    viagra without a doctor prescription
    appropriate viagra dose – https://genericviagramsl.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Cheers! I like it.

    viagra trial offer is chinese viagra safe
    generic viagra 100mg
    sales online viagra sale – https://genericviagramsl.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    You have made the point.

    pfizer japan viagra back pain search find viagra found
    generic viagra 100mg
    novocaine interacting with viagra – https://genericviagrantx.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

  52. LarryReoft 10 months ago
    Your comment is awaiting moderation.
  53. LarryReoft 10 months ago
    Your comment is awaiting moderation.

    Reliable content. Thanks!

    can viagra affect the prostate gland diabetes foundation course re viagra
    viagra generic
    is women there a women’s viagra – https://genericviagramsl.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Valuable postings. Appreciate it!

    buying viagra in canada wanted to buy viagra
    generic viagra online
    erectile dysfunction viagra sue – https://genericviagrarcp.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    You said it perfectly.!

    yang mei guangzhou china viagra iguana viagra
    buy viagra online
    search viagra viagra find generic edinburgh – https://genericviagrarcp.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    You actually mentioned that well.

    how does dilitiazem interact with viagra brand viagra on line
    buy viagra online
    wie funktioniert viagra – https://genericviagrantx.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Incredible lots of terrific information!

    venetian las vegas effects viagra viagra 10mg 20mg
    viagra 100mg
    find viagra free edinburgh search – https://genericviagrarcp.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Thank you! Plenty of data.

    viagra lavitra cialis viagra cialis compared
    viagra without a doctors prescription
    k b viagra uden recept – https://genericviagramsl.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

  59. LarryReoft 10 months ago
    Your comment is awaiting moderation.
  60. LarryReoft 10 months ago
    Your comment is awaiting moderation.

    Amazing stuff. Regards!

    soung viagra on the water herbal viagra alternative australia
    viagra for sale uk
    is viagra from india real – https://genericviagrarcp.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

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

    Really a good deal of wonderful tips.

    viagra ireland hgh human growth hormone buy viagra by pill
    generic viagra
    which is the best generic viagra – https://genericviagrarcp.com

    GeraldIsork
    DwayneStifs
    Kevinpyday

Leave a reply

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

*