我正在尝试通过引入新功能来修改Wordpress子主题的function.php文件。但是,添加该功能后,系统会一直显示错误。这是没有添加功能的原始代码(完全正常):
<?php
/*
* Custom functions that overwrites original Travelify functionality
*/
add_action( 'wp_enqueue_scripts', 'travelify_enqueue_styles' );
function travelify_enqueue_styles() {
wp_enqueue_style( 'travelify-parent-style', get_template_directory_uri() . '/style.css' );
}
?>
这是在添加新函数之后---导致错误:
<?php
/*
* Custom functions that overwrites original Travelify functionality
*/
add_action( 'wp_enqueue_scripts', 'travelify_enqueue_styles' );
function travelify_enqueue_styles() {
wp_enqueue_style( 'travelify-parent-style', get_template_directory_uri() . '/style.css' );
}
if ( ! function_exists( 'travelify_setup' ) ):
function travelify_setup() {
/** Load Structure */
require( get_template_directory() . '/library/structure/header-extensions.php' );
require( get_template_directory() . '/library/structure/sidebar-extensions.php' );
require( get_template_directory() . '/library/structure/footer-extensions.php' );
require( get_template_directory() . '/library/structure/content-extensions.php' );
/**
}
endif; // travelify_setup
?>
系统始终将?>
指向意外的文件结尾。我不是编码方面的专家,所以我不确定为什么会出现这样的错误。
提前感谢您的任何反馈。