Permalink for PDF of article

Using add_rewrite_endpoint <?php if ( ! class_exists( ‘PDFRewriteEndpoint’ ) ): class PDFRewriteEndpoint { /** * Add actions and filters in constructor. */ public function __construct() { add_action( ‘parse_request’, array ( $this, ‘sniff_requests’ ), 0 ); add_action( ‘init’, array ( $this, ‘add_endpoint’ ), 0 ); } /** * Add rewrite rules. */ public function add_endpoint() { … Read more

Call to undefined function wp_generate_attachment_metadata()

Despite you already solved it (the “undefined” issue), it should be noted that wp_generate_attachment_metadata() is defined in wp-admin/includes/image.php, so you need to manually load that file if you’re using the function on the front-end, i.e. public side of the site or non admin/wp-admin pages (e.g. single attachment pages). And in fact, the function reference says … Read more

Attach pdf from dynamic url

You can try to do it in two ways. The first one, much more simple, is to save a temporary PDF file somewhere, for example in a uploads directory, use it as attachment and delete if after the call to wp_mail() function is made: function my_custom_save_post( $post_id, $post, $update ) { if( ! $update ) … Read more

Print profile details as PDF or from modal window

Your question seems pretty specific to your situation, and while there might be a plug-in out there that can achieve what you’re looking for, it probably won’t fill all your needs without some hackery. So, have you considered creating a profile view on the front end and just setting up a print stylesheet for it? … Read more

How can I make an attachment page for pdf uploads?

You can use pdf.php or a number of other specially-named template files as described birgire’s answer to show an attachment page specifically for PDFs, or use a generic attachment.php page that includes conditional statements for the type of attachment (like the code in your question does). Potential Conflict with Yoast SEO Plugin Note that attachment … Read more

Embed interactive pdf

How did you tried to embed them? Is it post or page? My solution would be to add it into an iframe , add code below as html to your page/post. <iframe frameborder=”1″ height=”200″ name=”frame1″ scrolling=”yes” src=”http://download.belastingdienst.nl/belastingdienst/docs/aangifte_bpm_verzoek_teruggaaf_bpm_bpm0162z3plfol.pdf” width=”550″></iframe> you should change the width and height accordingly ofcourse. Let me know if it worked.

Password Protecting Media

an additional solution that may work and require no coding is to insert the PDF into a post and just have the post protected. Then insert the post onto the page