Öncelikle Görünüm sekmesinden düzenleyici bölümüne girip tema functions.php içerisine aşağıdaki kodu ekleyin.
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'); |
Sonra pdf dosyanızı ortam kütüphanesine yükleyin url adresi tam olarak alın. Aşağıdaki kodu ise yazılar içerisinde kullanacağınız pdf dosyasının görünmesini sağlayacak olan kod.
1 | [embedpdf width="600px" height="500px"]http://dosyanızın-tam-yolu.pdf[/embedpdf] |
NOT: İşlemleri yapmadan önce tema functions.php dosyanızın yedeğini almayı unutmayın..!