尝试以下更改:
if ($_SESSION['first_time_here'] == ''):
//SET PAGE TO CLOSED FOR OPENING
if (get_option('ub_sb_closed_on_hp') != 'yes'){
// print "
?>
if (jQuery(window).width() > 980){
jQuery('#page').css({'display':'inline','width':'300px','overflow':'hidden','margin-right':'340px'});
jQuery('#sidebar').css({'margin-left':'326px'});
}
// ";
<?php
}
?>
并且:
if (get_option('ub_sb_closed_on_hp') != 'yes'){
?>
// print "
if (jQuery(window).width() > 980){
jQuery('#sidebar').delay(800).animate({'margin-left':'0px'},2100);
jQuery('#page').delay(800).animate({'margin-right':'0px','width':'666px'},2100);
}
// ";
<?php
}
?>
编辑 1:我看不到你在哪里初始化$_SESSION['first_time_here']
. 如果您没有初始化它,您可以尝试以下更改
寻找:if($_SESSION['first_time_here'] == ''):
代替:if (!isset($_SESSION['first_time_here'])):