Shortcode pro přímé zobrazení PDF souboru

Just open *functions.php* file and put following code in that file.

/—code php
function pdflink($attr, $content) {
return ‚‚.$content.‘‚;
}
add_shortcode(‚pdf‘, ‚pdflink‘);
\—

Upload the PDF file to your wordpress and then get the path of PDF file and then put above lines in article.
For showing link of PDF file in article or post you need add the following lines in the article.

/—code php
[pdf href=“http://yoursite.com/linktoyour/file.pdf“]View PDF[/pdf]
\—

If you does not want to create PDF link in your site and you want to show the pdf doc in your site then use following code.

/—code php
function pdfshow($attr, $content) {
return ‚‚;
}
add_shortcode(‚pdfshow‘, ‚pdfshow‘);
\—

For showing the PDF file in article or post you need add the following lines in the article.

/—code php
[pdfshow href=“http://yoursite.com/linktoyour/file.pdf“]View PDF[/pdf]
\—

„Zdroj »“:http://wordpressapi.com/2011/01/18/show-pdf-file-wordpress-blog-site/