Closed. This question needs details or clarity. It is not currently accepting answers.admin管理员组文章数量:1310466
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this questionI have updated my site manually, now I get below mentioned notice in the front and backend:
Notice: register_sidebar was called incorrectly. No id was set in the arguments array for the "Main Sidebar" 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.)
How to fix this?
Closed. This question needs details or clarity. It is not currently accepting answers.Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this questionI have updated my site manually, now I get below mentioned notice in the front and backend:
Notice: register_sidebar was called incorrectly. No id was set in the arguments array for the "Main Sidebar" 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.)
How to fix this?
Share Improve this question edited Jan 19, 2021 at 8:47 fuxia♦ 107k38 gold badges255 silver badges459 bronze badges asked May 20, 2016 at 11:05 Sam JosephSam Joseph 611 gold badge1 silver badge2 bronze badges 02 Answers
Reset to default 14Find file where is
register_sidebar
( must be on theme folder or plugins )add ID to sidebar
register_sidebar( array( 'name' => __( 'Main Sidebar', 'theme-slug' ), 'id' => 'change_me', // Add only this line 'description' => __( 'Widgets in this area will be shown on all posts and pages.', 'theme-slug' ), 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>', ) );
Or you can just disable notification in wp-config.php
edit WP_DEBUG
to false
define('WP_DEBUG', false);
Looks like you have a very old theme. You'll have to search the functions.php
file for register_sidebar
and make sure the $args
follow the format mentioned in the codex.
本文标签: register sidebarregistersidebar notice
版权声明:本文标题:register sidebar - register_sidebar notice 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741822935a2399474.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论