How To Add Pdf To WordPress Post Using Media Uploader

Adding pdf to WordPress post is Our today’s topic and I will be sharing a straight forward trick on How you can add pdf to WordPress post using Media Uploader.

To add support pdf uploader button to WordPress post Add the following function in your theme’s funstions.php file just before the ?> symbol and you are done.adding pdf support to wordpress blog

  • Login to admin area.
  • Go to Appearance >>> Editor >>> Functions.php and add the below file before the ?> symbol and save.
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 (%s)', 'PDFs (%s)' ) );

	// then we return the $post_mime_types variable
	return $post_mime_types;

}

// Add Filter Hook
add_filter( 'post_mime_types', 'add_pdf_support' );

 

That is how to add pdf to WordPress post. Once you have added the above files into your Function php, you are good to go.

You can also read my post on how to turn blog post into pdf file.

I hope it works well for you too.
See you at the top :grin: .

Cheers!

About Azubuike Ikedionu

Azubuike is a tech a savvy, Founder and Editor-in-Chief at SilvaniBlog Media.

He is a web designer and has basic knowledge in php & html.

Get more from him on Facebook Page, Twitter Handle and Google +

Speak Your Mind

*

CommentLuv badge