Not able to show 'Featured Image' using shortcode

WordPress
17 November, 2024 08:46:42
Northsouth
Topics: 2
Messages: 10
I am trying to show the featured image on my E2PDF template using the shortcode: [e2pdf-wp key="featured_image"] but it will not work. I am unable to find any other shortcode for this (if there is one).
17 November, 2024 08:48:07
E2Pdf
Support
Topics: 7
Messages: 3330
Hello,

Could you please create a temporary "textarea" and map it with the shortcode [e2pdf-wp key="featured_image"]? Do you get any output, or is it just empty?
We would really appreciate your feedback at WordPress.org!
17 November, 2024 08:56:32
Northsouth
Topics: 2
Messages: 10
Hi. It's just empty - I have tried using an image field with the shortcode and a text area, but both are empty
17 November, 2024 09:17:17
E2Pdf
Support
Topics: 7
Messages: 3330
Could you please try using the shortcode?

[e2pdf-wp key="get_the_post_thumbnail"]

If it works, it's possible to get the full-size image as:

[e2pdf-wp key="get_the_post_thumbnail" size="full"]
We would really appreciate your feedback at WordPress.org!
17 November, 2024 09:56:42
Northsouth
Topics: 2
Messages: 10
I have used [e2pdf-wp key="get_the_post_thumbnail"] and it did work. I then tried [e2pdf-wp key="get_the_post_thumbnail" size="full"] and nothing appeared, so I reverted back to [e2pdf-wp key="get_the_post_thumbnail"] but now nothing is appearing with this code either!
17 November, 2024 10:01:59
E2Pdf
Support
Topics: 7
Messages: 3330
If you are using it within an HTML object, the image can be too large to fit. Try adding the following to the CSS section

img {
height: 100px;
width: auto;
}

P.S. To build custom HTML, it's also recommended to enable the 'Disable WYSIWYG Editor' option
We would really appreciate your feedback at WordPress.org!
17 November, 2024 10:03:19
Northsouth
Topics: 2
Messages: 10
I'm not building it in HTML, I'm using ACF
17 November, 2024 10:07:20
E2Pdf
Support
Topics: 7
Messages: 3330
Could you please clarify where you placed the shortcode [e2pdf-wp key="get_the_post_thumbnail"]?

Is the image you need to output in the PDF saved via ACF or through the Page/Post Featured Thumbnail?

If it's through ACF, please attach a screenshot of the ACF field setup
We would really appreciate your feedback at WordPress.org!
17 November, 2024 11:16:19
Northsouth
Topics: 2
Messages: 10
Yep - the [e2pdf-wp key="get_the_post_thumbnail"] was placed in the image field (top left). The screenshot also shows the rough layout of what I want to show. I've also included a screenshot of the ACF fields.
17 November, 2024 13:53:31
E2Pdf
Support
Topics: 7
Messages: 3330
We do not see any relation between the image and the ACF. The default thumbnail image should be displayed using the shortcode: [e2pdf-wp key="get_the_post_thumbnail"] if the post is using the default WordPress functionality for the featured image.

Can you try recreating the 'Image' object, setting the value to: [e2pdf-wp key="get_the_post_thumbnail"], and see if it helps?
We would really appreciate your feedback at WordPress.org!
17 November, 2024 15:20:31
Northsouth
Topics: 2
Messages: 10
I have recreated the Image and it does seem to be working when I check doing Export. However it isn't showing the code. I've attached a screenshot.
17 November, 2024 15:23:02
E2Pdf
Support
Topics: 7
Messages: 3330
It's the correct behavior. It should only work during export or PDF generation. The image, as shown in the screenshot, will remain in the preview or inside the E2pdf Template.
We would really appreciate your feedback at WordPress.org!
17 November, 2024 15:26:23
E2Pdf
Support
Topics: 7
Messages: 3330
If by 'under the code' you mean that ACF shortcodes do not render:

Check if you have enabled "Allow Access to Value in Editor UI" under the ACF field settings, as this is required for ACF shortcodes to work in the PDF: https://www.advancedcustomfields.com/blog/acf-6-3-6/

If it's enabled and still doesn't work, please try updating E2Pdf to the RC version, as it includes some enhancements to the ACF functionality: https://e2pdf.com/docs/install#rc-version
We would really appreciate your feedback at WordPress.org!
18 November, 2024 04:45:34
Northsouth
Topics: 2
Messages: 10
I have gone through and checked the "Allow Access to Value in Editor UI" and that does seem to have done the trick.

Thank you so much for your help on this!