我在窗口小部件中有一个滑块,它在某些页面上工作但在其他页面上没有。我查看了所有代码,我对此问题感到难过。下面是代码和指向一个页面工作和一个页面不起作用的链接。请帮忙。谢谢。
<?php
/*
Template Name: Join Now
*/
?>
<?php get_header();?>
<div class="inner">
<!-- Content Section Start -->
<div class="contentsec-new twocol">
<!-- Top Header Start -->
<div class="topheader">
<div class="inner">
<!-- Logo Start -->
<div class="logo">
<a href="<?php echo home_url();?>">
<?php if($logo_img = $_extracoding- >set_value('LOGO', get_template_directory_uri().'/images/logo.png', true)): ?>
<img src="<?php echo $logo_img;?>" alt="<?php bloginfo('name');?>" id="logo" />
<?php else:?>
<span class="logo"> </span>
<?php endif;?>
</a>
</div>
<!-- Logo End -->
<!-- Right Header Start -->
<div class="righthead">
<div class="topsec">
<!-- Service Time and Search Start -->
<!-- Service Time and Search End -->
<!-- Top Navigation Start -->
<div class="menuwrapper">
<?php $redirectTo = (is_home() || is_front_page()) ? home_url() : $_SERVER['REQUEST_URI'];?>
<?php if( ! is_user_logged_in()): ?>
<ul class="topnavi" style="float:right;">
<li><a href="javascript:animatedcollapse.toggle('loginbox')"><?php _e('Member Login', 'heavens_corner');?></a>
<!-- Login Bubble Start -->
<div id="loginbox"> <span class="logintop"> </span>
<div class="logincenter">
<h3 class="white bold upper"><?php _e('User Login', 'heavens_corner');?></h3>
<form action="<?php bloginfo('url');?>/wp-login.php" method="post" name="loginform" id="loginform">
<ul>
<li><h5 class="white"><?php _e('User Name', 'heavens_corner');?></h5></li>
<li><input name="log" type="text" class="bar" /></li>
<li><h5 class="white"><?php _e('Password', 'heavens_corner');?></h5></li>
<li><input name="pwd" type="password" class="bar" /><input type="hidden" value="<?php echo $redirectTo;?>" name="redirect_to" /></li>
<li><a href="<?php bloginfo('url');?>/wp-login.php?action=lostpassword" class="forgot"><?php _e('Forget Password?', 'heavens_corner');?></a> </li>
<li class="nopading"><input type="submit" value="<?php _e('Sign in Now', 'heavens_corner');?>" class="button backcolr" /></li>
</ul>
</form>
</div>
<span class="loginbottom"> </span> </div>
<!-- Login Bubble End -->
</li>
</ul>
<?php else:?>
<ul class="topnavi" style="float:right;">
<li><a href="<?php echo wp_logout_url( $redirectTo );?>"><?php _e('Logout', 'heavens_corner');?></a>
</ul>
<?php endif;?>
<?php wp_nav_menu(array('theme_location'=>'top-menu', 'container'=>false, 'menu_class'=>'topnavi', 'depth'=>2)); //Top menu?>
<br />
<?php wp_nav_menu(array('theme_location'=>'main-menu', 'container'=>false, 'menu_class'=>'subnavi', 'depth'=>2)); //Top menu?>
</div>
<!-- Top Navigation End -->
</div>
<ul class="boxed">
<?php get_template_part('modules/top_links');?>
<!-- Search Start -->
<li class="last">
<?php echo get_search_form(); //Search form ?>
</li>
<!-- Search End -->
</ul>
<div class="clear"></div>
<?php if($header_settings = get_option(THEME_PREFIX.'general_settings')):?>
<!--Header Short Text-->
<div class="watchlive">
<h3><?php echo character_limiter(kvalue($header_settings, 'header_text'), 50);?></h3>
</div>
<?php endif;?>
</div>
<!-- Right Header End -->
</div>
</div>
<!-- Top Header End -->
<div class="clear"></div>
<?php include_once('modules/main_slider.php');?>
<div class="clear"></div>
<!-- Bread Crumb Start -->
<div class="breadcrumb">
<?php echo get_the_breadcrumb(); ?>
</div>
<!-- Bread Crumb End -->
<!-- Sub Page Banner Start -->
<div class="subbanner">
<?php if(get_post_meta($post->ID, 'banner', true)) : ?>
<img src="<?php echo get_post_meta($post->ID, 'banner', true); ?>" />
<?php else : ?>
<?php the_title(); ?>
<?php endif; ?>
</div>
<!-- Sub Page Banner End -->
<!-- Column 3 Start -->
<div class="col3 border-right left" style="margin-top:24px;">
<!-- Blog Start -->
<div class="blog">
<!-- Blog Post Start -->
<?php while(have_posts()): the_post(); ?>
<div class="post noborder nopading">
<div class="post-heading-big">
<h3 class="colr bold"><?php the_title(); ?></h3>
</div>
<div class="clear"></div>
<?php if($post_image = fw_post_image('size=post-featured&src=0')):?>
<div class="post-thumb">
<a href="<?php the_permalink();?>"><?php echo $post_image;?></a>
</div>
<?php endif;?>
<?php if($_advanced_settings['publishing_info'] == 'active'):?>
<div class="post-feat">
<ul>
<li class="authore">
<?php _e('by,', 'heavens_corner');?>
<a href="<?php echo get_author_posts_url(get_the_author_meta('ID'));?>"><?php the_author(); ?></a>
</li>
<li class="comments">
<a href="<?php the_permalink(); ?>"><?php comments_number(); ?></a>
</li>
<?php if(has_tag()):?><li class="tags"><?php the_tags(); ?></li><?php endif;?>
</ul>
</div>
<div class="clear"></div>
<?php endif;?>
<div class="post-desc">
<?php the_content(); ?>
<!-- Social Network-->
<?php
if($_advanced_settings['show_links'] == 'active'):?>
<div class="post-share">
<script type="text/javascript">
(function() {
var s=document.createElement('script');s.type='text/javascript';s.async = true;
s.src='http://s1.smartaddon.com/share_addon.js';
var j =document.getElementsByTagName('script')[0];j.parentNode.insertBefore(s,j);
})();
</script>
<div id="sa_share_bar">
<ul>
<li><h6 class="bold"><?php _e('Share','heavens_corner');?></h6></li>
<li><a id="sa_share_facebook" layout="icon" size="24"></a></li>
<li><a id="sa_share_twitter" layout="icon" size="24"></a></li>
<li><a id="sa_share_googleplus" layout="icon" size="24"></a></li>
<li><a id="sa_share_email" layout="icon" size="24"></a></li>
<li><a id="sa_share_share" layout="icon" size="24"></a></li>
</ul>
</div>
</div>
<?php endif;?>
</div>
<?php endwhile; ?>
</div>
<!-- Blog Post End -->
<!-- Comments Start -->
<?php if($post->comment_count):?>
<div class="commentsection" id="comments">
<h3 class="colr heading"><?php _e('Comments', 'heavens_corner');?></h3>
<!-- Level One Comments Start -->
<?php comments_template( '', true ); ?>
<!-- Level One Comments End -->
</div>
<?php endif;?>
<!-- Comments End -->
<!-- Leave A Reply Start -->
<?php fw_comment_form(); ?>
<!-- Leave A Reply End -->
</div>
<!-- Blog End -->
</div>
<!-- Column 3 End -->
<!-- Column 1 Start -->
<div class="col1 right" style="margin-top:24px;">
<!-- Widget Start -->
<?php fw_dynamic_sidebars('page'); ?>
<!-- Widget End -->
</div>
<!-- Column 1 End -->
</div>
<!-- Content Section End -->
</div>
<div class="clear"></div>
<!-- Footer Start -->
<?php get_footer(); ?>
<!-- Footer End -->
工作:http://www.hbaofwashingtoncounty.org/hbawc2014/
不工作:http://www.hbaofwashingtoncounty.org/hbawc2014/join-now/
答案 0 :(得分:1)
看起来该页面上还有其他javascript冲突。 TypeError:$(...)。countdown不是函数join-now:357。修复可能会修复滑块。
尝试发表评论jQuery(function ($) {
var austDay = new Date(2014, 01 - 1, 16);
$('#defaultCountdown').countdown({until: austDay});
});
并查看其是否有效。