WordPress add_rewrite_rule redirection match GET variable not passing through to custom template

Remove $query parameter from add_rewrite_tag. Your rewrite tag registration will look like this: add_rewrite_tag('%expert%', '([^&]+)');.

The phrase in the rewrite rule may be '^expert/([^/]+)/?', but it was not the reason for the problem.

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