This occurs when I open admin or front on localhost

What version of WordPress are you running? Can you perhaps include the code from line 252 of that file? If it’s a current installation of WordPress, then it’s this: /** * @since 1.2.0 */ if ( !defined(‘COOKIEPATH’) ) define(‘COOKIEPATH’, preg_replace(‘|https?://[^/]+|i’, ”, get_option(‘home’) . “https://wordpress.stackexchange.com/” ) ); … And I can’t really see why that all … Read more

Help with find a bit of code to move from functions.php

Everything before this is malware: <?php /** * Listify child theme. */ Delete everything before that, including the ?> in front of it. Keep in mind that if someone got access to add this code, then they could’ve done a lot more. Follow all the steps in the codex: https://codex.wordpress.org/FAQ_My_site_was_hacked