$insert = $wpdb->insert( $prefix."posts", array("post_title" => $posTitle,"post_content" => $postContent,"post_status" => "publish","post_type" =>"product"));
// select products ID
$select = $wpdb->get_results("SELECT ID AS productsId FROM ".$prefix."posts WHERE post_title='".$posTitle."'");
//echo $select[0]->productsId; die();
// insert Image in pots and product attribute meta posts table
 $insertImg = $wpdb->insert($prefix."posts",array("post_status" =>"inherit","post_type" => "attachment","guid" => $postGuid,"post_parent" => $select[0]->productsId ));

I need a small, which table and column I need to insert to display product image in wordpress admin,I insert products by query in wordpress rather than insert product by admin

Read more here: How in insert image path in WordPress database that will display product image in wp admin not on front end?


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , , , , , ,

Wordpress related questions and answers: