使用该代码<img src="<?php echo esc_url( get_header_image() ); ?>" alt="<?php echo esc_attr( get_bloginfo( \'title\' ) ) ); ?>" />
, 我创建了一个函数。像这样的php
<?php
function get_header_image() {
$url = get_theme_mod( \'header_image\', get_theme_support( \'custom-header\', \'default-image\' ) );
if ( \'remove-header\' == $url ) {
return false;
}
if ( is_random_header_image() ) {
$url = get_random_header_image();
}
}
?>
但它显示了错误:
Fatal error: Cannot redeclare get_header_image() (previously declared in C:\\Program Files (x86)\\EasyPHP-Devserver-17\\eds-www\\wordpress\\wp-includes\\theme.php:1058) in C:\\Program Files (x86)\\EasyPHP-Devserver-17\\eds-www\\wordpress\\wp-content\\themes\\html5blank-stable1\\html5blank-stable\\functions.php on line 13
那我该怎么解决呢?