How to make the shortcode work

Help Desk ›› How to ›› How to make the shortcode work
WordPress
1 March, 2021 08:49:31
nspace1999
Topics: 1
Messages: 2
Hello

I use the free version. I have only one template activated with the id : 1.
So I use the shortcode on my single.php template

<?php echo do_shortcode('[e2pdf-download id="1"]'); ?>

But nothing shows on the page. Can you help ?I wanted to buy the pro version but I ma not sure the pro version works.
Thanks

1 March, 2021 09:04:33
nspace1999
Topics: 1
Messages: 2
I forgot to precise something :

Template is set on custom post type.
1 March, 2021 10:11:16
E2Pdf
Support
Topics: 7
Messages: 3331
Hi,

In case you need to use it via PHP call it must be defined "dataset" which is the custom Post ID for which it's need to generate PDF.

<?php echo do_shortcode('[e2pdf-download id="1" dataset="2"]'); ?>

<?php
$post_id = '2';
echo do_shortcode('[e2pdf-download id="1" dataset="'.$post_id.'"]');
?>

We remain at your service.
We would really appreciate your feedback at WordPress.org!