Google Docs is easy to read documents in .pdf, .doc or .xls online. Creating a shortcode that will open the PDF in Google Docs instead of forcing download?

Simply paste the code in your functions.php.

function pdflink($attr, $content) {
	return '<a class="pdf" href="' . $attr['href'] . '">'.$content.'</a>';
add_shortcode('pdf', 'pdflink');

Here is the syntax for using the shortcode on your posts and page.

[pdf href=""]View PDF[/pdf]

Recommended Posts

No comment yet, add your voice below!

Add a Comment

Het e-mailadres wordt niet gepubliceerd.