Changing custom post type URL issue

Your post_type_link uses the post’s ID, but the item query var expects a postname. To query by ID you need to use the p query var and set post_type:

add_rewrite_rule('food/([^/]+)/?$','index.php?post_type=item&p=$matches[1]','top');

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