Modify site URL via functions.php of a theme

If instead of modifying functions.php you can modify wp-config.php, you can use the following:

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Source: https://codex.wordpress.org/Changing_The_Site_URL#Edit_wp-config.php

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