admin管理员组文章数量:1331927
I am building a new theme from scratch as part of my auto learning process. I have added the lines to register a new widget area in functions.php
as follow:
<?php
/**
* Including the widget area.
*/
function theme_widget_areas_init() {
register_sidebar( array(
'name' => _('Topbar Left'),
'id' => 'topbar-left',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
) );
}
add_action( 'widgets_init', 'theme_widget_areas_init' );
Also I have set and specific area within my index.php
file for the sidebar.
<?php if (is_active_sidebar('topbar-left')) :?>
<?php dynamic_sidebar('topbar-left'); ?>
<?php endif ?>
Finally the issue is that my widget perfectly appears on the Appearance/Widget area and is active with a text widget just as a test, also the front-end side shows the widget with its content. However the Customize area does not show the widget area and instead displays the already pretty common text:
Your theme has 1 widget area, but this particular page doesn’t display them.
Well, so for consideration:
- Yes, the template includes the
wp_head()
andwp_footer()
tags. - Yes, I already checked the php error log and seems ok.
- Yes, I am in the index in the Customize and is the page I placed the sidebar on, I know it because it shows me the actual widget but on the view, not in the options though.
- I also have tried the Health Checker plugin and it showed Good and did not fix the issue either.
I am building a new theme from scratch as part of my auto learning process. I have added the lines to register a new widget area in functions.php
as follow:
<?php
/**
* Including the widget area.
*/
function theme_widget_areas_init() {
register_sidebar( array(
'name' => _('Topbar Left'),
'id' => 'topbar-left',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
) );
}
add_action( 'widgets_init', 'theme_widget_areas_init' );
Also I have set and specific area within my index.php
file for the sidebar.
<?php if (is_active_sidebar('topbar-left')) :?>
<?php dynamic_sidebar('topbar-left'); ?>
<?php endif ?>
Finally the issue is that my widget perfectly appears on the Appearance/Widget area and is active with a text widget just as a test, also the front-end side shows the widget with its content. However the Customize area does not show the widget area and instead displays the already pretty common text:
Your theme has 1 widget area, but this particular page doesn’t display them.
Well, so for consideration:
- Yes, the template includes the
wp_head()
andwp_footer()
tags. - Yes, I already checked the php error log and seems ok.
- Yes, I am in the index in the Customize and is the page I placed the sidebar on, I know it because it shows me the actual widget but on the view, not in the options though.
- I also have tried the Health Checker plugin and it showed Good and did not fix the issue either.
1 Answer
Reset to default 1Thanks to the wordpress forums, some grateful one just helped me finding the answer. So If you come here looking for a solution. Please first try the options I put in the post before, they did not work for me but they did for other users, so give them a try first.
If for some reason, just like me, you still have problems with the Customizer then open your console in google chrome and check for errors in javascript because as Joy suggested it to me here the Customizer has a lot of JS
and specially uses jQuery
.
To summarize, I could fix the problem by removing my calling to jQuery for Bootstrap in my theme and let it just use the default one in wordpress. So far, there has been no problem with the CSS library so I hope this is done.
本文标签: customizationCustomize section does not show my widget areas
版权声明:本文标题:customization - Customize section does not show my widget areas 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742253141a2441136.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论