wp_get_attachment_image_src()
takes ID of attachment “post type” (in quotes because it’s native WP post type so not quite same thing as CPT).
Now while users are shared in multisite, posts are not. The ID (94
) that points to specific attachment in your main site has no meaning whatsoever in any other site of your multisite.
At which point it boils down to mucking with getting data from different site. It might be easier approach to store actual URL to image in user metadata as well.
Related Posts:
- Missing feature image link function
- Add image size if page template
- Set JPEG compression for specific custom image sizes
- Prevent “main” WPMU site_url() being returned in functions
- remove links from images using functions.php
- Issue with wp_get_attachment_image() and SVG file type
- How to change the markup WordPress inserts for post images
- Programmatically Set First Image as Featured
- Removing default image size list in Media Box
- How to use get_template_directory_uri() to load an image that is in a sub-folder of my theme?
- WP 4.4. responsive loads normal image after loading the responsive image
- How to add classes to images based on their categories?
- How to create thumbnails for PDF uploads?
- Implementing DNS Prefetching with WordPress
- How to reduce original image quality on upload?
- Is it possible to maintain image aspect ratio when scaling images?
- Auto delete WordPress images/thumbnails (all sizes) and featured after X days/hours, or similar?
- Set image size on media and text block with a function
- Generating Responsive Background Image Sizes in PHP
- Why are image thumbnails cropped proportionally (not per dimensions)?
- Create thumbnail on PDF upload with Gravity Forms
- Gallery images titles – get from post
- Remove images from get_the_excerpt
- Use Exact Image Size using add_image_size
- How to add a rel attribute to images that contains their categories?
- Why are image thumbnails cropped proportionally (not per dimensions)?
- Different functions file for each site in multisite installation?
- Display height and width properties with the_post_thumbnail() or related function
- Insert width & height attributes to all images displayed on each page
- Custom image size in Media Dropdown
- Best way to programatically add “rel” attributes to page and post images
- Removing the first image in content
- Function to auto-set a featured image that is already in use
- Delete pages and Create default pages for all new network sites
- Actions according to image type and size
- Multisite, either change the name of sample-page or create new page
- Woocommerce Storefront WordPress Ignore Media Gallery Images and use External 3rd Party Host
- Overwrite Parent Theme add_image_size in Child Theme
- Images uploaded using media uploader are appearing upside down
- How to add css class to image attached in all the posts?
- Loop (iterate) through Multi-Site sub-sites (blogs)?
- Add custom image size not working
- Global functions on WPMU
- Count total number of images in post and echo results as number
- How can you limit srcset on a single type of page?
- restore_current_blog required after switch_to_blog, if I use that in a function?
- how to add an image to the footer?
- wp_get_attachment_image function size argument not working if I also add a custom class
- Automatically wrap multiple images in div
- Run function when WordPress new multisite is created or ACF field is updated
- Understanding and altering the structure of posted images
- Overwriting Parent Theme’s Image Sizes
- Image rotation fails to regenerate custom sized thumbnail
- Publish/Update post is changing image links from file url to post url
- Featured Image Thumbnail Creation
- Twentyten Child Theme: header images display messed up in admin panel
- Disable auto-resizing of uploaded images, but only for certain filename
- Display images that are not in the content
- Can you put a condition on add_image_size() depending on the width of the uploaded image?
- show first 3 thumbnails of posts in different sizes [closed]
- Remove after images
- Conditional Gravity Forms filter in WordPress Multisite
- Getting custom image size URL in functions
- Set spesific size of featured images
- Multisite Ajax serialize return error [object Object]
- Can’t generate thumbnail images
- Creating new blog on multisite programatically without hacks?
- How to get correct URLs in network wide menu (Multisite)?
- media resize/crop possibilities?
- Multisite 404 on pages – rewrite error breaks database
- Has is_archived() for sites in a multisite changed with WP 4.7?
- Redirect to another page using contact form 7? [closed]
- Function that outputs second theme url
- Control the srcset much more (not all sizes in it each time)
- Way to store featured image width and height in two separate variables?
- srcset and custom field get_post_meta and wp_get_attachment_url
- Limit dimensions of “Full” size images
- Visual Composer creating own shortcodes with vc_map() to return simple Image
- How to hide image-url if no attachment?
- What are the meta fields for an attachment?
- Woocommerce image sizes missing from Appearance › Customize but not declared by theme
- How to properly set custom logo size?
- Add attribute only to first image of every post via functions.php
- Full size image option removing problem
- Function to get thumbnail img source
- Run function from parent on child site
- Image width issue in IE [closed]
- image_size with respect to aspect ratios
- Ads Only at one website inside multisite network – code error
- Different ads on every website on multisite environment
- How to resize image from import image url?
- How to crop image in WordPress with aspect ratio for any size of image
- How to add height and width dimensions automatically to archive descriptions
- How to overwrite image if it already exists – WordPress, Gravity form
- How Do I Prevent Featured Image Caption Displaying Above And Below Image
- How to force Cover block to use the full size image resolution
- warning: trying to access array offset on value of type bool ACF field image group
- Custom User Role not working
- Add custom text before all image captions in WordPress posts
- add_image_size() parameter four ($crop = true) is ignored: the_post_thumbnail() returns scaled image(s) instead of hard cropped