Skip to main content

Posts

Showing posts from 2011

Create a PDF Viewer ShortCode

Do you need to show PDF files on your WordPress Blog. If yes here is a small code for this. This will gives a feature to open the PDF files using Google Docs . The first step is to paste the following code into your functions.php file: function pdflink($attr, $content) { return '<a class="pdf" 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 post, Please Consider Sharing it! You may also like to read: How to turn off Find My iPhone How to fix 'iPhone is disabled Connect to iTunes' error messages How to mirror/screencast iPhone to a smart TV how to Delete All Photos from iPhone How to make Chrome default browser How