Why:
In WordPress one can only attach a file to a single parent post. This is because the relationship is stored in the wp_post
table as the post_parent
field. It’s a bigint(20)
type so it can only contain a single number (ID).
Workaround:
We would need to cook something ourselves, maybe that could be by using a custom taxonomy for our attachments or perhaps using custom fields (post meta) to store the attachments IDs?
Or we could try some plugins out there that can help us re-using our attachments.
Related Posts:
- How can I add an image upload field directly to a custom write panel?
- How to implement add_image_size in a plugin
- How to catch images with blank dimensions?
- How to find attachment ID for first image in a post
- Having Problem On Getting WP Post Gallery Images URL
- Set first image (external) as featured image / thumbnail
- Hook event for upload image in the menu
- How to get an image transferred via FTP or script to appear in Media Manager?
- Is there a better way to implement responsive images than what WordPress uses by default?
- Save image as featured image
- How to show large image in checkout page using WP Ecommerce plugin [closed]
- Hook to get image filename when it is uploaded
- Resizing Images for a Gallery-Plugin?
- How to serve different thumbnails/images depending on users browser/platform
- How to Upload Images From a Folder (Not WP_Uploads)
- How to export post meta with images in wordpress
- Get attachments from a post
- Putting a resized image into media library with wp_get_image_editor(
- Display list of uploaded images, filtered by user under a specific user group
- Upload multiple images and insert them into custom html code
- Which is the better way to store images for the plugin?
- Uploaded attachment not set as featured image
- How do I change the image from the default mysteryman in the WP Profile page
- Hook after attachment added and cropped
- Conditional Generation of Image Sizes using add_image_size
- how to change image of jquery slider plugin
- WP Still Generating 150×150 Thumbnail Size Even After Un-Setting Small Size in Functions.php
- Cleaning a filename after image sideloading a url that contains `%20`
- How to list all images used on a specific page?
- Screenshots on plugin page taken old [closed]
- Resize not resizing images with Capitial extension like JPG
- How to move an image in a plugin to the upload directory and make it as a media of wordpress?
- The URL of images on my website changed after being set as featured image
- Getting incorrect filepath inside custom block front-end output using @wordpress/create-block tutorial
- WordPress Favicon not Working For Images/Videos/PDFs
- Adding the image selector/uploader to an admin back page
- WordPress discards PNG file when uploading plugin file
- Hook for validating and rejecting frontend image upload
- WordPress Iframe for blog image
- Replace the WordPress Media Library Uploader
- Caption Shortcode: what filter to change the image size?
- Filter the_content() to add custom figure tags
- Issue on Getting WP Gallery Items In cpt-single.php As Attachments
- Is it possible to convert various image types from remote URLs to WebP and then serve them immediately?
- Images not displaying on live server
- Using “add_image_size” to register custom image sizes inside plugins not working
- Leveraging Core Functionality in Icon Upload Plugin [closed]
- Displaying an Uploaded Image as a Custom Avatar in WordPress
- Add a custom image source
- Upload to a specific media folder created by FileBird Lite
- Set srcset on a block image
- Where to store PHP files created by plugin / themes
- WordPress 4.5 deprecated get_currentuserinfo()
- Admin config screen without menu
- What is the added “complexity” of custom tables?
- Why does preg_replace_callback never fire in this function?
- WordPress 2.8 Widget API is suitable for Worpress 3.1.4 plugins development?
- Call to undefined function get_blog_option()
- Unable to get content from $post on first publish
- Script to get a list of all images that are detached?
- Gutenberg: useDispatch is not a function – @wordpress/data included
- How to get orders with used coupon in WooCommerce
- Generate dynamic page through data from another page
- Why not to include reference to /wp-admin/admin.php in Plugin
- Comments do not respect display_name setting, how to make plugin to overcome this
- How to Debug: My Plugin Interferes With My Theme
- How to stop activation addon if the main plugin is not activated
- How would you compose a complex plugin with lots of routes and functions? [closed]
- Show error, when selecting image in WordPress media uploader if params mismatch
- What plugin development paradigm differences have occurred between version 3.5 and now?
- Error: Call to a member function get_error_code() on a non-object
- WordPress: How to rename the main php plugin base file?
- Filter for admin (back end) ‘reply to’ comment
- How to get custom post_author?
- Is there any way to hide page from dashboard (all pages list) OR navbar from plugin function?
- WordPress database error: [Query was empty] – using $wpdb->prepare()
- wp.media Uncaught TypeError: Cannot read properties of undefined (reading ‘state’)
- Showing results from json-string in WordPress search results page
- Pass custom props to
- Make visible page only in the trash
- Reading plugin settings in esnext wordpress block
- Plugin frontend page design irrespective of the theme used
- WP_Fatal_Error_Handler OR WP_Error OR try/catch
- Why does do_action pass a blank string as the first parameter if no $arg is set?
- How to store in the database directly the translation?
- How to affect front page by plugin
- What is the “best” way to update a theme via a plugin?
- Is there a an option to modify the post content directly on the browser instead of having it reflected on browser by modifying in the database?
- Custom theme and plugin updating
- What method should I use to store my plugin data (multi level menus with options on each item)
- How to show post attachment image
- Error on using __FILE__ for add_menu_page() Function
- Getting error of unexpected output during activation
- Use custom clean URLs for a plug in
- Projectmanager Internal Link Code Location
- Select options not reloading after form submit
- Plugin SVN folder structure
- how many rupee or dollar charge to client to make theme [closed]
- Load images from CDN and custom features to “Add Media” dialogue
- Saving metabox updates causing fatal error