Stripping attachment from page
-
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)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Stripping attachment from page’ is closed to new replies.