Posted by KaiseRCrazY on 2nd March 2010
Create PDF Button
This is a simple button for display PDF’s with Google Docs. You can easily apply this code into your theme’s functions.php. And this useful thing has 4 lines code. Let’s Begin…
Here is the code;
Add this line into your theme’s functions.php;
function pdflink($attr, $content) {
return '<a class="pdf" href="http://docs.google.com/viewer?url=' . $attr['href'] . '">'.$content.'</a>';
}
add_shortcode('pdf', 'pdflink');
That’s All. Now use your shortcode;
[pdf href="http://yoursite.com/linktoyour/file.pdf"]View PDF[/pdf]
This tip orginally posted in WpRecipes.
- Wordpress
Filed Under
This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.
-
Categories
Colored Tags
javascript RSS comment template if functions.php theme hide mysql robots content Widget blog code posts site function no-index Google feed category plugin Loop Facebook funcitons comments.php header.php title image Functions Wordpress css single.php time spiders comments index.php post categories article author sidebar else style.css YahooRecent Comments
Archives
Blogroll
Google Ads















Made by Symmetric Web
Distributed by Smashing Magazine
No comments yet!