I created a plugin where woocommerce users can individually upload an image to an individual table in the database and retrieve that image (and description) via shortcode. (It’s literally the same as Instagram)
​
if i place the shortcode on the (for arguments sake) about page it shows the upload button ect and my images.
​
if another user is logged in and goes on the about page, it shows their images associated with their account to.
​
the issue is, when i put the shortcode on the STORE profile page, it only shows the current users images that are uploaded and not the persons profile im looking at.
​
how do i get it to stop showing my images and show the users profile im looking at currently to show their images?
​
[https://github.com/pasinc20/instagram]) [ad_2]
[link to code on github])
i Have thi php code but it seems to be not pulling the images fromt he correct tables associated with the plugin?
​
`<?php`
`$username = get_query_var(‘author_name’); // get the username from the URL`
`$user = get_user_by(‘slug’, $username); // get the user by their username`
`$images = get_user_meta($user->ID, ‘image’, true); // get the images associated with this user`
`// check if there are any images for this user`
`if (!empty($images)) {`
`foreach ($images as $image_id) {`
`$image = wp_get_attachment_image($image_id); // get the image`
`$image_description = get_post_field(‘post_content’, $image_id); // get the image description`
`echo $image;`
`echo $image_description;`
`}`
`} else {`
`echo ‘No images have been uploaded’;`
`}`
`?>`