0

So what I'm wanting to do is be able to use the url of an attachment page for a PDF file, post that link on Facebook, and be able to customize the preview/featured image that shows up there.

I've tried adding facebook og image code to the Description section when I go in to edit the attachment file in the wordpress backend, but I can't seem to get that to work.

Is there a way to accomplish this or am I out of luck?

Thanks!

2
  • How are you generating the og:image meta tags for the rest of your site - manually, or with a plugin? I suspect your plugin would work if you could put the right postmeta data on the attachment post record, but it'd depend on your plugin's UI for it.
    – Rup
    Commented Jan 28, 2021 at 15:53
  • That's assuming your attachment page shows an HTML page, i.e. you have an appropriate attachment template in your theme or the regular post template just works OK. You could always make a simple post with the PDF instead of the attachment page and set up the og:image on that page as usual.
    – Rup
    Commented Jan 28, 2021 at 15:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.