Images uploaded to listing, missing from media library
This topic contains 11 replies, has 4 voices, and was last updated by Craig Bennett 10 years, 7 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
August 7, 2014 at 1:38 pm #11297
Hi,
Not sure if this is a bug or intended behavior.
When uploading images to a listing, via the add listing page, only the first image uploaded is actually added to the WordPress Media library, even when multiple images are added.
This is causing me a couple of problems,
Firstly, I’m trying to change the default slider, the slider I’m using can pull all images attached to the post using post_id, problem is there is only ever 1 attached to that post according to wp, even when there are multiple.
Secondly, I use wp migrate dB pro to sync my database’s between local, staging and eventually live, this plugin also sync’s my media library and images, but again only the one image that is actually added to the media library is being synced.
Is there an easy way to add all the images to the media library during the upload process?
Cheers, Craig
August 7, 2014 at 1:40 pm #11298Are you using Payment plugin? Have a look at the settings there, they might have been set to 1 image allowed only?
August 7, 2014 at 2:02 pm #11300Hi Guust,
That’s not the issue I’m having, on the post type in question it’s set to unlimited images, and the images display fine on the actual listing detail page, using the default slider.
The problem is there is only 1 showing in the WordPress media library, even if I’ve upload 5 images to an individual listing.
Cheers, Craig
August 7, 2014 at 6:06 pm #11340Hi,
images are visible in the edit form right sidebar?
(see image attached)
August 7, 2014 at 6:50 pm #11343Hi Paolo,
I’d found the images in the backend, but that’s not the issue.
As far as WordPress is concerned the only image attached to the post is the featured image, which I believe is the first one uploaded. I presume because you are not using the WordPress Media uploader for the images.
My question was, is there a way to let WordPress know all the images uploaded are part of the post, so that for example if I use:
$media = get_attached_media( ‘image’, $post->ID );I’d be able to pull all the attached images from the post, not just the first / featured image. Which is currently the case.
It’s for a customisation I’m trying to make that needs to be able to access all the images attached to a particular post, using get_attached_media from the post ID.
This worked fine in GeoTheme, as any images uploaded to the post would also be attached and show up in the WordPress Media Library.
Hope this makes sense.
Cheers, Craig
August 7, 2014 at 7:20 pm #11346You can use geodir_get_images();
Example of code used to display thumbnails in detail page tab:
$post_images = geodir_get_images($post->ID,'thumbnail'); $thumb_image = ''; if(!empty($post_images)){ foreach($post_images as $image){ $thumb_image .= '<a href="'.$image->src.'">'; $thumb_image .= geodir_show_image($image,'thumbnail',true,false); $thumb_image .= '</a>'; } }
and in the tab content:
echo $thumb_image;
Hope this helps.
Thx
August 7, 2014 at 7:49 pm #11350Brilliant, I’ll give that a try and see if it works.
Thanks
August 7, 2014 at 8:21 pm #11354Hi Paolo,
I’ve given that a try and can print the images, but it’s not going to achieve what I’m trying to do.
The only way it’ll work for me is if the images can be attached to the actual post some way, so I can call all of them just using the $post->ID. It’s just the way the plugin works it requires a post id and automatically pull’s all the images.
So my question is, is there an easy work around that would attach all the images to the post, i.e. so they will also show in the WordPress media library.
Cheers, Craig
August 7, 2014 at 11:50 pm #11361It would have to be an option, I don’t think I want all the images attached to the listing?
Is your plugin is based on a wp Gallery?
You could probably hack the plugin, along the lines that Paolo outlined above, so that it has a list of images. That is probably what the plugin does with the passed post id.
August 8, 2014 at 11:57 am #11393I agree an option in the admin would be good, I understand that it’s probably done this way to reduce requests from the wp-database and wouldn’t be suitable for everyone.
But , I do feel there any many benefits using the WordPress media uploaded, rather than the custom build system. Such as the ability to edit alt tags and descriptions, and the fact that WP automatically creates different image sizes, which is a great benefit for responsive design, especially with the upcoming html picture element.
I was trying to swap out the flexslider with the Soliloquy slider, it basically just pulls all images it finds attached to a post. With the added benefits of being much more customisable, if I could get it to work!
I’d thought about hacking the plugin, but can see many more benefits if all images were attached to the listing and visible from the media library as the were in GeoTheme.
August 8, 2014 at 6:50 pm #11414Hi,
we were able to reduce database calls by a great deal not attaching all images to the place the wordpress way.
I don’t think we are willing to go back and make the plugin less performant, to allow to use a different slider with it.
It would makes much more sense to customize the slider plugin (like we did with flexslider) to make it work with GD.
Thx
August 8, 2014 at 7:29 pm #11418Hi Paolo,
I wouldn’t have expected you to change the plugin for my benefit. It works fine the way it is. I’m just messing about and trying a few different things.
I’ll have a mess about myself and see if I can come up with a solution.
Cheers, Craig
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket