我想在访客访问网站时在我的div中显示动态侧边栏。有什么想法吗?
<?php
if ( is_user_logged_in() ) {
echo '';
} else {
echo '<div class="slideraanmeldbuiten">
<div class="slideraanmeldbinnen">
<div class="slideraanmeld">
<div class="slideraanmeldinside">
<?php
// Custom widget Area Start
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Zoektermen 1') ) : ?>
<?php endif;
// Custom widget Area End
?>
</div>
</div></div></div>';
};
?>
答案 0 :(得分:0)
<?php
if ( is_user_logged_in() ) {
echo '';
} else {
echo '<div class="slideraanmeldbuiten">
<div class="slideraanmeldbinnen">
<div class="slideraanmeld">
<div class="slideraanmeldinside">
<?php
// Custom widget Area Start
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Zoektermen 1') ) : ?>
<?php endif;
// Custom widget Area End
?>
<?php
'</div>
</div></div></div>';
};
?>
控制你关闭它的php标签,而不是打开最后一个标签。你也忘记了&#39;标签
答案 1 :(得分:0)
这样做自己:
<?php if( is_home() || is_front_page() ) : ?>
<?php if ( !is_user_logged_in() ) : ?>
<div class="slideraanmeldbuiten">
<div class="slideraanmeldbinnen">
<div class="slideraanmeld">
<div class="slideraanmeldinside">
<?php if( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Aanmeldvak') ) : ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php endif; ?>