Wordpress中的主题"Ronneby"问题,不要让我编辑任何内容



我在测试前使用ronneby主题。由于这个主题,我无法修改网站管理员上的几乎所有内容。(顺便说一句,几天前大家都在工作(前端工作正常。你可以在www.probioclageno.com上查看,但后端给了我以下错误:

PHP Notice:  Undefined offset: 0 in /home/nutrafood/public_html/probiocolageno/wp-content/themes/ronneby/inc/cleanup.php on line 58
PHP Notice:  Undefined offset: 0 in /home/nutrafood/public_html/probiocolageno/wp-content/themes/ronneby/inc/cleanup.php on line 59 

这些行中的代码是(这是第51到60行(:

/**
* Clean up output of stylesheet <link> tags
*/
function dfd_clean_style_tag($input)
{
preg_match_all("!<link rel='stylesheet's?(id='[^']+')?s+href='(.*)' type='text/css' media='(.*)' />!", $input, $matches);
// Only display media if it's print
$media = $matches[3][0] === 'print' ? ' media="print"' : '';
return '<link rel="stylesheet" href="' . $matches[2][0] . '"' . $media . '>' . "n";
}

从哪里开始的任何线索都将受到的赞赏

编辑:该函数(dfd_clean_style_tag(也在同一文件中,前几行(第34行(:add_filter('style_loader_tag', 'dfd_clean_style_tag');

试试这个:

remove_filter('style_loader_tag', 'dfd_clean_style_tag');
add_filter('style_loader_tag', 'your_dfd_clean_style_tag');
function your_dfd_clean_style_tag($input) {
preg_match_all("!<link rel='stylesheet's?(id='[^']+')?s+href='(.*)' type='text/css' media='(.*)' />!", $input, $matches);
// Only display media if it's print
if ( ! empty( $matches[3][0] ) ) {
$media = $matches[3][0] === 'print' ? ' media="print"' : '';
return '<link rel="stylesheet" href="' . $matches[2][0] . '"' . $media . '>' . "n";
} else {
return '';
}
}

相关内容

最新更新