简体   繁体   English

幻灯片在Wordpress中不起作用

[英]Slideshow not working in Wordpress

I have a slider inside a widget and it's working on some pages but not on the others. 我在小部件内有一个滑块,它在某些页面上有效,但在其他页面上却不可用。 I have looked through all the code and I am stumped on the issue. 我仔细阅读了所有代码,对这个问题感到困惑。 Below is the code and links to one page working and one page not working. 下面是代码和指向一页有效和一页无效的链接。 Please help. 请帮忙。 Thank you. 谢谢。

<?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">&nbsp;</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">&nbsp;</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">&nbsp;</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 -->             

Working: http://www.hbaofwashingtoncounty.org/hbawc2014/ 工作: http//www.hbaofwashingtoncounty.org/hbawc2014/

Not working: http://www.hbaofwashingtoncounty.org/hbawc2014/join-now/ 无法运作: http//www.hbaofwashingtoncounty.org/hbawc2014/join-now/

It looks like there are other javascript conflicts on that page. 该页面上似乎还有其他JavaScript冲突。 TypeError: $(...).countdown is not a function join-now:357. TypeError:$(...)。countdown不是函数join-now:357。 Fixing that will likely fix the slider. 修复可能会修复滑块的问题。

Try commenting out jQuery(function ($) { var austDay = new Date(2014, 01 - 1, 16); $('#defaultCountdown').countdown({until: austDay}); }); 尝试注释掉jQuery(function ($) { var austDay = new Date(2014, 01 - 1, 16); $('#defaultCountdown').countdown({until: austDay}); }); and see if it works. 看看是否可行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM