当用户登录并且我正在使用is\\u user\\u logged\\u函数时,我正在尝试更改侧栏。以下是代码-
<!-- BEGIN sidebar -->
<?php
/**
* The Sidebar containing the primary and secondary widget areas.
*
* @package WordPress
* @subpackage Twenty_Ten
* @since Twenty Ten 1.0
*/
?>
<div id="primary" class="widget-area" role="complementary">
<ul class="xoxo">
<?php
/* When we call the dynamic_sidebar() function, it\'ll spit out
* the widgets for that widget area. If it instead returns false,
* then the sidebar simply doesn\'t exist, so we\'ll hard-code in
* some default sidebar stuff just in case.
*/
if ( ! dynamic_sidebar( \'primary-widget-area\' ) ) : ?>
<li class="widget-container">
<h3 class="widget-title">Sign In / Register</h3>
<ul>
<?php if ( is_user_logged_in() ) { echo \'Welcome, registered user!\';} else { echo \'Welcome, unregistered user!\';} ?>
</ul>
</li>
<li id="meta" class="widget-container">
<h3 class="widget-title"><?php _e( \'Meta\', \'twentyten\' ); ?></h3>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<?php wp_meta(); ?>
</ul>
</li>
<?php endif; // end primary widget area ?>
</ul>
</div><!-- #primary .widget-area -->
<!-- END sidebar -->
当用户登录时,侧边栏会显示它应该做什么。当用户注销时,它将完全消失。我做错了什么?