关于主题,我有一个问题,我在本地主机上测试了主题后,在主机上尝试了:当我尝试发布、更新、更改选项时,我得到了一个空白的白色页面
然后我启用了调试模式,它会给我这些错误
Notice: register_sidebar was called incorrectly. No id was set in the
arguments array for the "footer" sidebar. Defaulting to "sidebar-1".
Manually set the id to "sidebar-1" to silence this notice and keep existing
sidebar content. Please see Debugging in WordPress for more information.
(This message was added in version 4.2.0.) in
/home/ar4web/public_html/wordpress/wp-includes/functions.php on line 4139
Warning: Cannot modify header information - headers already sent by (output
started at /home/ar4web/public_html/wordpress/wp-
content/themes/ar4web/functions.php:1) in
/home/ar4web/public_html/wordpress/wp-
content/themes/ar4web/plugins/rf/ReduxCore/inc/class.redux_functions.php on
line 56
Warning: Cannot modify header information - headers already sent by (output
started at /home/ar4web/public_html/wordpress/wp-
content/themes/ar4web/functions.php:1) in
/home/ar4web/public_html/wordpress/wp-admin/post.php on line 197
Warning: Cannot modify header information - headers already sent by (output
started at /home/ar4web/public_html/wordpress/wp-
content/themes/ar4web/functions.php:1) in
/home/ar4web/public_html/wordpress/wp-includes/pluggable.php on line 1210
我甚至不知道我必须在我的函数中编辑什么。php
我的函数php是:
<?
/* Start Footer Widget */
register_sidebar( array(
\'name\' => \'footer\',
\'before_widget\' => \'<div class="col-md-3 col-sm-6 footer-col">\',
\'after_widget\' => \'</div>\',
\'before_title\' => \'<div class="logofooter">\',
\'after_title\' => \'</div><ul class="footer-ul">\',
) );
/* End Footer Widget */
/* Start Post Thumbnails */
add_theme_support( \'post-thumbnails\' );
if ( function_exists( \'add_theme_support\' ) ) {
add_theme_support( \'post-thumbnails\' );
set_post_thumbnail_size( 200, 352, true );
}
/* End Post Thumbnails */
/* Start Theme Panel */
if ( !class_exists( \'ReduxFramework\' ) && file_exists( dirname( __FILE__ ) . \'/plugins/rf/ReduxCore/framework.php\' ) ) {
require_once( dirname( __FILE__ ) . \'/plugins/rf/ReduxCore/framework.php\' );
}
if ( !isset( $redux_demo ) && file_exists( dirname( __FILE__ ) .
\'/plugins/rf/sample/sample-config.php\' ) ) {
require_once( dirname( __FILE__ ) . \'/plugins/rf/sample/barebones-
config.php\' );
}
/* End Theme Panel */
/* Start Menu */
function register_my_menu() {
register_nav_menu(\'header-menu\',__( \'الناف بار\' ));
}
add_action( \'init\', \'register_my_menu\' );
/* End Menu */
/* Start ACF */
// 1. customize ACF path
add_filter(\'acf/settings/path\', \'my_acf_settings_path\');
function my_acf_settings_path( $path ) {
// update path
$path = get_stylesheet_directory() . \'/plugins/acf/\';
// return
return $path;
}
// 2. customize ACF dir
add_filter(\'acf/settings/dir\', \'my_acf_settings_dir\');
function my_acf_settings_dir( $dir ) {
// update path
$dir = get_stylesheet_directory_uri() . \'/plugins/acf/\';
// return
return $dir;
}
// 3. Hide ACF field group menu item
add_filter(\'acf/settings/show_admin\', \'__return_false\');
// 4. Include ACF
include_once( get_stylesheet_directory() . \'/plugins/acf/acf.php\' );
include_once( get_stylesheet_directory() . \'/plugins/acf/panel.php\' );
/* End ACF */
include_once( get_stylesheet_directory() . \'/plugins/lwm/plugin.php\');
?>
最合适的回答,由SO网友:Samuel Asor 整理而成
调用侧栏的函数"needs to be called" 并且还需要id
并应采用以下格式:
add_action( \'widgets_init\', \'your_custom_sidebar\' );
function your_custom_sidebar() {
register_sidebar( array(
\'name\' => __( \'Footer Sidebar\', \'your_theme_lang\' ),
\'id\' => \'footer-sidebar\',
\'description\' => __( \'Some description\', \'your_theme_lang\' ),
\'before_widget\' => \'<div class="col-md-3 col-sm-6 footer-col">\',
\'after_widget\' => \'</div>\',
\'before_title\' => \'<div class="logofooter">\',
\'after_title\' => \'</div><ul class="footer-ul">\',
) );
}