The following snippet will let you set simple embedding PDF shortcode in WordPress.
1 2 3 4 | function viewpdf($attr, $url) { return '<iframe src="http://docs.google.com/viewer?url=' . $url . '&embedded=true" style="width:' .$attr['width']. '; height:' .$attr['height']. ';" frameborder="0">Your browser should support iFrame to view this PDF document</iframe>'; } add_shortcode('embedpdf', 'viewpdf'); |
Snippet Source/Credit: WPRecipes.com