id for categories and products

Try this, I have updated it with a hook for when you save the product, try saving a product and see if it assigns everything correctly add_action(‘save_post_product’, ‘wpb_assign_product_to_categories_on_save’); function wpb_assign_product_to_categories_on_save($post_id) { // Check if this is a valid call if (defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE) return; // Check the user’s permissions if (!current_user_can(‘edit_post’, $post_id)) return; // Call … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)