班特网的教程很好。
另一个对我有用的教程(实际上有点简单)如下所示:
http://futurewebblog.com/add-sidebar-support-posts-twenty-eleven-theme/
下面是我在函数中添加的内容。php文件,在学习了这两个教程之后:
/*
* Fix for no sidebar in single posts
* From http://futurewebblog.com/add-sidebar-support-posts-twenty-eleven-theme/
*/
/* In child themes the functions.php is applied before the parent
* theme\'s functions.php. So we need to wait for the parent theme to add
* it\'s filter before we can remove it.
*/
add_action( \'after_setup_theme\', \'my_child_theme_setup\' );
/**
* Removes the filter that adds the "singular" class to the body element
* which centers the content and does not allow for a sidebar
* By http://futurewebblog.com/add-sidebar-support-posts-twenty-eleven-theme/
*/
function my_child_theme_setup() {
remove_filter( \'body_class\', \'twentyeleven_body_classes\' );
}
我不需要对CSS做任何更改,而且很有效!
HTH。杰夫