我正在尝试从Wordpress主题上的滑块中删除视差效果,但没有太多运气,有人可以建议我需要对以下代码进行更改以删除视差吗?谢谢你的帮助!
add_shortcode( 'full_screen_slider', 'bravo_full_screen_slider' );
function bravo_full_screen_slider( $atts, $content ){
extract(shortcode_atts(array(
'slider_categories'=>'',
'padding_top'=>'160',
'padding_bottom'=>'160',
),$atts));
$output= "";
if(empty($slider_categories))
$tax_query = '';
else
$tax_query = array( array('taxonomy' => 'slider_categories', 'field' => 'slug', 'terms' => explode(',', $slider_categories), 'operator' => 'IN') );
$args = array(
'post_type'=>'slider',
'tax_query' => $tax_query,
'posts_per_page' => -1
);
$flex_slides = new WP_Query($args);
while ( $flex_slides->have_posts() ) :$flex_slides->the_post();
if (has_post_thumbnail(get_the_ID()) ) {
$attachment_id = get_post_thumbnail_id(get_the_ID());
$attachment_info=wp_get_attachment_image_src( $attachment_id,'full');
$attachment_url = $attachment_info[0];
}
$temp_array ='<div class="slidecontent">'.apply_filters('the_content', get_the_content(get_the_ID())).'</div>';
if(get_post_meta(get_the_ID(),'bravo-more-link',true)) {
$temp_array.='<a class="uppercase read-more-btn" href="'.get_post_meta(get_the_ID(),'bravo-more-link',true).'">'.__('Continue Reading','bravo').'</a>';
}
if(empty($attachment_url))
$attachment_url = '';
$output .= '<div class="slider parallax"><div class="background-animate" style="background: url('.$attachment_url.') 50% 0 no-repeat scroll;"></div><div class="content-area orbit-caption">'.$temp_array.'</div></div>';
endwhile;
wp_reset_query();
return '<div class="full-screen-slider-wrap"><div class="full-width-slider">'.$output.'</div></div>';
}
add_shortcode( 'full_screen_slider_module', 'bravo_full_screen_slider_module' );
function bravo_full_screen_slider_module( $atts, $content ) {
extract(shortcode_atts(array('slider_categories'=>'', 'padding_top'=>'160', 'padding_bottom'=>'160',),$atts));
return '<section class="section full-screen-slider no-parallax">'.do_shortcode('[full_screen_slider slider_categories="'.$slider_categories.'" padding_top="'.$padding_top.'" padding_bottom="'.$padding_bottom.'"]').'</section>';
}