Move images from a custom field to post_images
This topic contains 19 replies, has 3 voices, and was last updated by Kiran 4 years, 7 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
April 18, 2020 at 8:22 am #541061
Hi, I was using a custom field (files) for image (one per listing) as i needed custom fallback rules which was not possible at that time. So i was using gd_post_meta shortcode to display the image in a custom field (key: image_test)
Now with fallback_types option available, i don’t need to use the custom field and I want to use the post_images (as that has advantages eg image shows in embed/opengraph, which custom field does not).
How can i move all the existing images in the field ‘image_test’ to the field ‘post_images”?
thanks, Vivek
April 18, 2020 at 8:46 am #541062Also, i just realised yesterday that the fallback_types allows me to do what i could not earlier. I had in fact asked about the fallback order about a year ago (https://wpgeodirectory.com/support/topic/post_images-fall-back-order/) and at that time it was suggested to use a custom field with gd_post_meta.
Somehow i missed noticing the update when the fallback_type was introduced, and just saw it yesterday – i do usually look at the update list before updating (though much of it is “don’t understand”or “not relevant”), but is there a better way for me to know about such changes?
thanks, Vivek
April 18, 2020 at 12:17 pm #541084Tried to export> copy the image_test to post_images > import
that did not work…i have max one image in each listing, so the URL is like :
pasted it in the post_images and imported but that does not work, again exporting shows post_images blank
Any suggestions please, thanks
April 18, 2020 at 7:00 pm #541108Hello,
In post images try
https://www.staging37.kidwise.in/wp-content/uploads/2020/03/87602824_689170185159403_1003242684615229440_n.jpg|||
April 19, 2020 at 10:00 am #541198Hi Alex, tried that – didnt work.
Attaching the csv in which i had exported, and added the URLS in post_images. GD shows records updated but the featured image / post_images is not updated. Do I need to add :: but i thought that is only for multiple imgs..
April 19, 2020 at 10:05 am #541203This reply has been marked as private.April 20, 2020 at 8:28 pm #541449Have you tried it without the browser protection on?
I can’t login to check it because of the browser protection.
April 21, 2020 at 2:03 am #541498Hi Alex, yes i was importing wihtout the browser protection. have turned it off so you can check please.
thanks,vivek
April 21, 2020 at 6:08 am #541525Hi Vivek,
There is easy way to move images from custom fields to post images via manually from database.
Here are the steps:
– Go to database & browse database table DB_PREFIX_geodir_attachments
– Update attachments table column type and change it to post_images (Ex: change image_test to post_images in type column)
– Save blank value for the image_test column in detail table.After doing this all the images will be displayed under post images.
Make backup first before doing this.
Let us know.
Thanks,
KiranApril 21, 2020 at 6:46 am #541528Thanks, Kiran – will try this. But i am not clear about hte last step – “– Save blank value for the image_test column in detail table.” Does this mean that each record in each of the DB_PREFFIX_CPT_detail tables in column image_test i shall need to save a NULL individually? or did you mean something else?
Since i wont be needing the “image_test” column anyway now, is it okay if i skip the last step, and just remove that custom field in CPT settings, after doing the first 2 steps?
thanks, Vivek
April 21, 2020 at 7:06 am #541530Does this mean that each record in each of the DB_PREFFIX_CPT_detail tables in column image_test i shall need to save a NULL individually?
Yes
You can delete “image_test” custom field after making value of image_test field for each posts. Otherwise it will delete images uploaded under image_test custom field. In short you must save empty value for image_test before removing that custom field.
Thanks,
KiranApril 21, 2020 at 7:49 am #541541Ok, got it. Thanks very much, Kiran.
April 21, 2020 at 8:42 am #541550Hi Kiran- so that worked for getting the images into post_images, however the image is not getting set in featured_image for the post. I have only one post_images so GD should make that featured image, but thats not happening?
thanks, Vivek
April 21, 2020 at 8:47 am #541555There is some extra functionality to set image as a featured. Try to re-save the listing and let us know how it goes.
Steps i provided just moves images from custom field to post images. It does not set featured image.
Thanks,
KiranApril 21, 2020 at 9:01 am #541558Okay – saving the listing does not set the featured image. So what is the way to do that now?
will i need to set the featured image in the DB also?
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket