POST/UPDATE/CHANGE选项等时空白白页

时间:2017-09-28 作者:Wael Mahmoud

关于主题,我有一个问题,我在本地主机上测试了主题后,在主机上尝试了:当我尝试发布、更新、更改选项时,我得到了一个空白的白色页面

然后我启用了调试模式,它会给我这些错误

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\');
  ?>

1 个回复
最合适的回答,由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">\',
    ) );
}

结束

相关推荐

在函数.php中使用$_POST数据

我想将一个参数从以前访问过的页面传递到一个页面,并在一个快捷码函数中使用它。为此,我在函数的范围内编写函数。php:$currency=$_POST[\'currency\']但它总是返回空的。正确的方法是什么?编辑:我猜是这样的。php在被其他文件调用时有一个空的$\\u POST,而不是直接由用户调用。如何访问函数中的\\u POST数据。那么php呢?