Hi, I am adding a listing through custom coding with “wp_insert_post” function and also uploading images. Listing is added and images are uploaded as attachments. We have kept the attachment ids in the serialized way against the meta key “_transient_hp_models/attachment”. But the images are not showing in the details page of the listing. Why it is not showing? Is the meta key incorrect?
We have the theme “ListingHive” installed in my site.
Please make sure that you have updated the HivePress extension to the latest version, as we added a fallback in the latest update, so all the images should be displayed.
I mean images are not showing in the listing edit page in admin. I have inserted the attachments in wp_posts table as post_type=‘attachment’ and post_parent=‘that listing id’. Then why the images are not showing uploaded from the external script? Images are showing if listings are added through admin.
Please consider using our API for adding attachments if you’re familiar with the code. If you add attachments via WP functions, please also try adding these meta fields to the attachment:
hp_parent_model with value “listing”
hp_parent_field with value “images”
Then if the attachment is an image, it’ll appear in the listing gallery.
Thanks for the suggestion. We tried this but still images are not showing in admin though the images are uploaded. Will we add the post metas “hp_model” and “hp_field” with respect to the attachment id of the images or the post id of the listing?