Just received a request by contact form, to write a post about adding .pdf file in the Media uploader of WordPress, so here it is. Working lat at night though it feels awesome :)
How to Add support of Uploading .pdf Files in WordPress
Add the following function in your theme’s funstions.php file just before the ?> symbol and you are done
[ad]
function add_pdf_support( $post_mime_types ) { // select the mime type, here: 'application/pdf' // then we define an array with the label values $post_mime_types['application/pdf'] = array( __( 'PDFs' ), __( 'Manage PDFs' ), _n_noop( 'PDF <span class="count">(%s)</span>', 'PDFs <span class="count">(%s)</span>' ) ); // then we return the $post_mime_types variable return $post_mime_types; } // Add Filter Hook add_filter( 'post_mime_types', 'add_pdf_support' );
[ad]
I hope it works well at your end.
Catch you all later.
3 replies on “How to Add support of Uploading .pdf Files in WordPress”
Hi Ahmad…..
That’s really cool and most wanted stuff in blogger.
You have shared an easy to implement code for it.
Thanks for sharing it with us.
Thanks for liking the tip.
It is a pretty good post. This post contains useful information which helps us a lot. I visit your website often and share with my friends.