update outdated script, remove comments code, migrate custom function to functions.php

Signed-off-by: M.Satrya <satryabima24@gmail.com>