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:
- 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
- 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
- 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?
- Generating Responsive Background Image Sizes in PHP
- Why are image thumbnails cropped proportionally (not per dimensions)?
- Gallery images titles – get from post
- How to add a rel attribute to images that contains their categories?
- Why are image thumbnails cropped proportionally (not per dimensions)?
- Display height and width properties with the_post_thumbnail() or related function
- 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
- Images uploaded using media uploader are appearing upside down
- 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?
- Automatically wrap multiple images in div
- Run function when WordPress new multisite is created or ACF field is updated
- Overwriting Parent Theme’s Image Sizes
- Image rotation fails to regenerate custom sized thumbnail
- Twentyten Child Theme: header images display messed up in admin panel
- Disable auto-resizing of uploaded images, but only for certain filename
- Can you put a condition on add_image_size() depending on the width of the uploaded image?
- Remove after images
- Conditional Gravity Forms filter in WordPress Multisite
- 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
- Add attribute only to first image of every post via functions.php
- Need To Change WordPress Meta Tags… Includes wordpress shortcodes
- Need to convert image url to a Base_64 data url with wordpress function..
- How to Add Shortcode to html img code?
- How to add a new image size and apply it to posts only?
- Problem in using Customizer
- functions.php return custom text
- Custom Image Size in Insert Media
- Dashboard blocker on network multisite for specific user roles
- Using add_image_size in functions.php to get original uploaded file
- get_image_tag() html output : empty src attribute
- Need To Resize Images Exactly Without Losing Image Details
- Custom image sizes showing in Classic Editor only when upladed directly to post
- how can I change all wordpress media file url to custom cdn url?
- Members only function, but allow account activation [solved]
- How to change images url in function.php?
- How to update an image attachment’s alt text from a custom field when saving a post?
- Class parameter in get_avatar args doesn’t get added to output
- blank page with wp_get_attachment
- Competing Login Redirects – Need to be Combined?
- Images with overlay
- Adding a class to the body of an inactive site using multisite
- Featured image on archive page based on post type
- Printing medium sized image
- Why am I losing image quality on my site?
- Replace image attributes for lazyload plugin on image elements with specific class
- Zip all (original) images from media gallery
- No compression occurs on my jpegs after adding jpeg_quality hook to my functions.php file
- Different body image backgrounds on different pages, posts and categories
- Update add_image_size
- Function the_content
- Dynamically adding Captions to images
- Full size image option removing problem
- 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
- 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