0
votes

I want to adapt my old custom website database (composed of only one table) to Wordpress database.

All data has been correctly imported in both tables (wp_posts and wp_postmeta) with a php code that I can share if needed.

Here is a screenshot of my wp_posts table...wp_posts screenshot

...and a screenshot of my wp_postmeta table (I imported only one entry to facilitate understanding). wp_postmeta screenshot

As you can see, wp_posts/post_parent column of id 2 (referring to the featured image) is well linked to id 1 (which is the post).

But in my wordpress admin panel, I still have no linked featured image.blank featured image

Is there another place where the image and the post have to be linked?

1

1 Answers

1
votes

To display data (images) from another database, you can:

  1. create a child theme
  2. in the child theme, create custom templates for pages/lists where the external data (images) will be displayed
  3. in the functions.php of the child theme, write a function that interpolates the id's of the wp_postmeta to the external database
  4. with this interpolation, return the image link desired and provide it to the template as a variable
  5. with the variable of the image link, display your related data (image)