0

I am trying to display the images in the media library inside the elementor view.

When I try to upload files programmatically, the file is uploaded but not displayed in the Media Library grid view. Until I refreshed the page.

On the other other hand, if I upload images using Media Library upload button, it gets automatically displayed in the grid view.

Why is that. ?

0

You have to insert the following :

wp_postmeta This table contains 2 records:

  1. For the URL meta_key: _wp_attached_file meta_value: image url post_id: meta_id:

  2. post_id and meta_id are the same as record above. meta_key: _wp_attachment_metadata meta_value: serialize size information

wp_posts A record entry for each image, where it is entered into a post, along with the post ID.

Without these records, WordPress does not know to display the uploaded images.

  • I am faced with this exact same annoying issue. Unfortunately I don't understand your answer here. Are you saying we have to make two manual DB entries every time we upload a new image? That's far more annoying than just saving and refreshing the Elementor page, at which point they appear in the media gallery within Elementor. Or am I misunderstanding your answer? – JVC Mar 4 at 16:43
  • You are miss understanding my answer. This was a while ago for me, so if I can remember. It has to do with the tables in the WordPress system. There is one for wp_postmeta and within that it contains the URL meta_key and the post_id. – Debbie Kurth Mar 4 at 21:08
  • The other table is wp_posts_, where there is a record for each entry. To wordpress, the images are just another post-type. You can create PHP code that will insert these yourself into the database and then it will appear in the library. – Debbie Kurth Mar 4 at 21:09
  • OK... I'm not looking to code anything, I just want Elementor to realize that, outside of it I have updated the media library... but it doesn't. So I have to save what I'm doing and reload. Not the end of the world but I was hoping for a better way. Thanks. – JVC Mar 5 at 2:35
-1

Setting wp_posts ID field and wp_postmeta meta_ID field to auto increment, using PhpMyAdmin. SOLVED MY PROBLEM.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.