Страницы

вторник, 12 апреля 2016 г.

Как удалить ссылки в футере Вордпресс?

Удалили ссылку из футера и получили "All the links in the footer should remain intact. All of these links are family friendly and will not hurt your site in any way."


В functions.php находим строку:  


function wp_initialize_the_theme_load() { if (!function_exists("wp_initialize_the_theme")) { wp_initialize_the_theme_message(); die; } } function wp_initialize_the_theme_finish() { $uri = strtolower($_SERVER["REQUEST_URI"]); if(is_admin() || substr_count($uri, "wp-admin") > 0 || substr_count($uri, "wp-login") > 0 ) { /* */ } else { $l = 'Designed by: <a href="http://www.luxurysuperyachts.info/">Yachts</a> | Thanks to <a href="http://www.luxurysuperyachts.info/">Super yachts</a> and <a href="http://www.luxurysuperyachts.info/">Luxury super yachts</a>'; $f = dirname(__file__) . "/footer.php"; $fd = fopen($f, "r"); $c = fread($fd, filesize($f)); $lp = preg_quote($l, "/"); fclose($fd); if ( strpos($c, $l) == 0 || preg_match("/<\!--(.*" . $lp . ".*)-->/si", $c) || preg_match("/<\?php([^\?]+[^>]+" . $lp . ".*)\?>/si", $c) ) { wp_initialize_the_theme_message(); die; } } } wp_initialize_the_theme_finish();

И закомментируем кусочек wp_initialize_the_theme_message(); die; чтобы сайт не умирал)) Вот так:

    function wp_initialize_the_theme_load() { if (!function_exists("wp_initialize_the_theme")) { wp_initialize_the_theme_message(); die; } } function wp_initialize_the_theme_finish() { $uri = strtolower($_SERVER["REQUEST_URI"]); if(is_admin() || substr_count($uri, "wp-admin") > 0 || substr_count($uri, "wp-login") > 0 ) { /* */ } else { $l = 'Designed by: <a href="http://www.luxurysuperyachts.info/">Yachts</a> | Thanks to <a href="http://www.luxurysuperyachts.info/">Super yachts</a> and <a href="http://www.luxurysuperyachts.info/">Luxury super yachts</a>'; $f = dirname(__file__) . "/footer.php"; $fd = fopen($f, "r"); $c = fread($fd, filesize($f)); $lp = preg_quote($l, "/"); fclose($fd); if ( strpos($c, $l) == 0 || preg_match("/<\!--(.*" . $lp . ".*)-->/si", $c) || preg_match("/<\?php([^\?]+[^>]+" . $lp . ".*)\?>/si", $c) ) { /* wp_initialize_the_theme_message(); die; */ } } } wp_initialize_the_theme_finish();

Теперь футер можно спокойно чистить.

Комментариев нет:

Отправить комментарий