• Hi all,

    Is it possible to attach an attachment (image) to a page in my wordpress site without it being in the content of that page? So that it just acts as a reference?

    What I’m doing right now is inserting the image in the post. In my template, I have the loop in which I use the function wp_get_attachment_image_src(); this returns an array which I use in an image element.

    After that I strip the image from the_content() using preg_replace() otherwise I’ll end up with the picture displayed twice. This works, but doesn’t seem too elegant. Is there a way to attach the image to the page without it being in the post itself?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Simply upload the image whilst within the post’s Edit Post page.

    Thread Starter ivwp

    (@ivwp)

    Thanks for your reply. Let’s say I want an already uploaded image in another page as well how would I do that? It’s already uploaded…

    [edit] I understand this is a media library shortcoming for quite some time now… From what I can see it’s (still) not possible to (de)attach images to multiple pages or just the ones you see fit?

    From what I can see it’s (still) not possible to (de)attach images to multiple pages or just the ones you see fit?

    Correct. For now, you have to upload the image for each page/post and delete it from each when it’s no longer needed.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Stripping attachment from page’ is closed to new replies.