对于为什么自定义侧边栏在更新4.4后会停止在Wordpress主题中显示,您有任何初始想法吗?我们的登录/加入页面在页面右侧显示了一个自定义边栏,其中包含登录/连接表单,直到更新。这不是一个自定义的侧边栏插件,它是主题的一部分。有什么想法吗?非常感谢!自定义侧边栏随着Wordpress 4.4更新消失
可以启用默认侧边栏,但任何自定义创建的侧边栏都会呈现空白。
代码登记的functions.php内边栏:
include('functions/custom-sidebars.php');
全码::
`//// GETS的sidebar.php内
include('includes/sidebar/sidebar.php');
代码我们的自定义侧边栏 $ sidebars = get_option('dd_custom_sidebars');
//// IF THEY EXIST
if($sidebars) {
//// LOOPS AND REGISTERS THEM
foreach($sidebars as $sidebar) {
$args = array(
'name' => $sidebar.' — Custom',
'id' => us_get_sidebar_id($sidebar),
'description' => $sidebar.' — Custom Sidebar',
'before_widget' => '<div class="sidebar-item">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
);
//// REGISTERS IT
register_sidebar($args);
}
}
/// FUNCTION TO GENERATE OUR FRIENDLY NAME
function us_get_sidebar_id($phrase) {
$result = strtolower($phrase);
$result = preg_replace("/[^a-z0-9\s-]/", "", $result);
$result = trim(preg_replace("/[\s-]+/", " ", $result));
$result = trim(substr($result, 0, 20));
$result = preg_replace("/\s/", "-", $result);
return $result;
}`
我不确定你的意思,我可以在您的网站右侧看到登录表单... –
这是一个添加到每个页面上显示的默认侧栏的临时表单。以前,我们为每个页面定制了侧边栏,例如您访问过的登录页面。它实际上是活跃的,但没有显示。 – JoeW
在wp-config文件中启用WP-DEBUG。那么会显示错误。 –