dongshun1884 2013-10-01 20:40
浏览 34

删除Wordpress主题的视差效果

I'm trying to remove the parallax effect from a slider on a Wordpress theme but not having much luck, can anyone suggest the changes I need to make to the following code to remove the parallax? Thanks for the help!

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>';
}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 公交车和无人机协同运输
    • ¥15 stm32代码移植没反应
    • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
    • ¥100 连续两帧图像高速减法
    • ¥15 组策略中的计算机配置策略无法下发
    • ¥15 如何绘制动力学系统的相图
    • ¥15 对接wps接口实现获取元数据
    • ¥20 给自己本科IT专业毕业的妹m找个实习工作
    • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
    • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)