我遇到问题,我无法在主页上显示图像滑块。
它应位于此处: http://new.solacetree.org/。
悲伤节目和出版物之间的权利&资源。
我在WordPress v.4.2中使用Easing Slider(v.2.2.1.1)和Soliloquy(v.2.3.0)的短代码:
[soliloquy slug="home-pubs"]
[easingslider id="2009"]
它在其他页面上有效: http://new.solacetree.org/publications-resources/如您所见,两个滑块都会出现。
这两个页面的唯一区别是主页有两个侧栏,另一页有一个。
我不确定在其他页面上的主页上缺少什么使它无效。
我发现在页脚中我在主页上缺少以下代码,但是在另一页上:
<link rel='stylesheet' id='soliloquy-lite-style-css' href='http://new.solacetree.org/wp-content/plugins/soliloquy-lite/assets/css/soliloquy.css?ver=2.3.0' type='text/css' media='all' />
<link rel='stylesheet' id='easingslider-css' href='http://new.solacetree.org/wp-content/plugins/easing-slider/css/easingslider.min.css?ver=2.2.1.1' type='text/css' media='all' />
<script type='text/javascript' src='http://new.solacetree.org/wp-content/plugins/soliloquy-lite/assets/js/min/soliloquy-min.js?ver=2.3.0'></script>
<script type='text/javascript' src='http://new.solacetree.org/wp-content/plugins/easing-slider/js/jquery.easingslider.min.js?ver=2.2.1.1'></script>
<script type="text/javascript">if ( typeof soliloquy_slider === 'undefined' || false === soliloquy_slider ) {soliloquy_slider = {};}jQuery('#soliloquy-container-2011').css('height', Math.round(jQuery('#soliloquy-container-2011').width()/(550/200)));jQuery(window).load(function(){var $ = jQuery;var soliloquy_container_2011 = $('#soliloquy-container-2011'),soliloquy_2011 = $('#soliloquy-2011');soliloquy_slider['2011'] = soliloquy_2011.soliloquy({slideSelector: '.soliloquy-item',speed: 400,pause: 5000,auto: 1,useCSS: 0,keyboard: true,adaptiveHeight: 1,adaptiveHeightSpeed: 400,infiniteLoop: 1,mode: 'fade',pager: 1,controls: 1,nextText: '',prevText: '',startText: '',stopText: '',onSliderLoad: function(currentIndex){soliloquy_container_2011.find('.soliloquy-active-slide').removeClass('soliloquy-active-slide');soliloquy_container_2011.css({'height':'auto','background-image':'none'});if ( soliloquy_container_2011.find('.soliloquy-slider li').size() > 1 ) {soliloquy_container_2011.find('.soliloquy-controls').fadeTo(300, 1);}soliloquy_2011.find('.soliloquy-item:not(.soliloquy-clone):eq(' + currentIndex + ')').addClass('soliloquy-active-slide');soliloquy_container_2011.find('.soliloquy-clone').find('*').removeAttr('id');},onSlideBefore: function(element, oldIndex, newIndex){soliloquy_container_2011.find('.soliloquy-active-slide').removeClass('soliloquy-active-slide');$(element).addClass('soliloquy-active-slide');},onSlideAfter: function(element, oldIndex, newIndex){},});});</script>
这些行之间有代码,我留有空格,所以我不认为它是函数的东西:
<?php wp_footer(); ?>
我确实将以下内容添加到我的functions.php文件中,主题创建者说这是为了在一个页面上设置双侧边栏。我不知道它会如何改变页脚中显示内容的方式,但如果有帮助的话,它就会存在。
/* Home Page Layout */
add_filter( 'generate_sidebar_layout','generate_custom_homepage_sidebar_layout' );
function generate_custom_homepage_sidebar_layout( $layout )
{
// If we are on a woocommerce page, set the sidebar
if ( is_front_page() )
return 'both-sidebars';
// Or else, set the regular layout
return $layout;
}
编辑:我删除了上面的功能,它没有改变任何东西,所以我把它留在那里。
任何建议都表示赞赏。
答案 0 :(得分:0)
在你的主页html上似乎缺少滑块的JS和CSS
例如
<link rel='stylesheet' id='soliloquy-lite-style-css' href='http://new.solacetree.org/wp-content/plugins/soliloquy-lite/assets/css/soliloquy.css?ver=2.3.0' type='text/css' media='all' />
<link rel='stylesheet' id='easingslider-css' href='http://new.solacetree.org/wp-content/plugins/easing-slider/css/easingslider.min.css?ver=2.2.1.1' type='text/css' media='all' />
<script type='text/javascript' src='http://new.solacetree.org/wp-content/plugins/soliloquy-lite/assets/js/min/soliloquy-min.js?ver=2.3.0'></script>
<script type='text/javascript' src='http://new.solacetree.org/wp-content/plugins/easing-slider/js/jquery.easingslider.min.js?ver=2.2.1.1'></script>
<script type="text/javascript">if ( typeof soliloquy_slider === 'undefined' || false === soliloquy_slider ) {soliloquy_slider = {};}jQuery('#soliloquy-container-2011').css('height', Math.round(jQuery('#soliloquy-container-2011').width()/(550/200)));jQuery(window).load(function(){var $ = jQuery;var soliloquy_container_2011 = $('#soliloquy-container-2011'),soliloquy_2011 = $('#soliloquy-2011');soliloquy_slider['2011'] = soliloquy_2011.soliloquy({slideSelector: '.soliloquy-item',speed: 400,pause: 5000,auto: 1,useCSS: 0,keyboard: true,adaptiveHeight: 1,adaptiveHeightSpeed: 400,infiniteLoop: 1,mode: 'fade',pager: 1,controls: 1,nextText: '',prevText: '',startText: '',stopText: '',onSliderLoad: function(currentIndex){soliloquy_container_2011.find('.soliloquy-active-slide').removeClass('soliloquy-active-slide');soliloquy_container_2011.css({'height':'auto','background-image':'none'});if ( soliloquy_container_2011.find('.soliloquy-slider li').size() > 1 ) {soliloquy_container_2011.find('.soliloquy-controls').fadeTo(300, 1);}soliloquy_2011.find('.soliloquy-item:not(.soliloquy-clone):eq(' + currentIndex + ')').addClass('soliloquy-active-slide');soliloquy_container_2011.find('.soliloquy-clone').find('*').removeAttr('id');},onSlideBefore: function(element, oldIndex, newIndex){soliloquy_container_2011.find('.soliloquy-active-slide').removeClass('soliloquy-active-slide');$(element).addClass('soliloquy-active-slide');},onSlideAfter: function(element, oldIndex, newIndex){},});});</script>
滑块本身的DIV没有被输出到代码中
<div class="soliloquy-wrapper"></div>
<div class="easingslider"></div>