Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/themify-.../template...
File: template-slider-blog.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Template Slider Blog
[2] Fix | Delete
*
[3] Fix | Delete
* This template can be overridden by copying it to your child_theme_folder/themify-builder/template-slider-blog.php.
[4] Fix | Delete
*
[5] Fix | Delete
* Access original fields: $args['settings']
[6] Fix | Delete
* @author Themify
[7] Fix | Delete
*/
[8] Fix | Delete
[9] Fix | Delete
defined( 'ABSPATH' ) || exit;
[10] Fix | Delete
[11] Fix | Delete
global $themify;
[12] Fix | Delete
$mod_name = $args['mod_name'];
[13] Fix | Delete
$type = $args['settings']['layout_display_slider'];
[14] Fix | Delete
$fields_args = $args['settings']+ array(
[15] Fix | Delete
'post_type' => 'post',
[16] Fix | Delete
'taxonomy' => 'category',
[17] Fix | Delete
$type . '_category_slider' => '',
[18] Fix | Delete
'posts_per_page_slider' => '',
[19] Fix | Delete
'offset_slider' => '',
[20] Fix | Delete
'order_slider' => 'desc',
[21] Fix | Delete
'orderby_slider' => 'date',
[22] Fix | Delete
'display_slider' => 'content',
[23] Fix | Delete
'excerpt_length' => '',
[24] Fix | Delete
'hide_post_title_slider' => 'no',
[25] Fix | Delete
'hide_feat_img_slider' => 'no'
[26] Fix | Delete
);
[27] Fix | Delete
if (!empty($fields_args[$type . '_category_slider'])) {
[28] Fix | Delete
$fields_args[$type . '_category_slider'] = self::get_param_value($fields_args[$type . '_category_slider']);
[29] Fix | Delete
}
[30] Fix | Delete
if ($type !== 'blog') {
[31] Fix | Delete
$fields_args['post_type'] = $type;
[32] Fix | Delete
$fields_args['taxonomy'] = $type . '-category';
[33] Fix | Delete
}
[34] Fix | Delete
// The Query
[35] Fix | Delete
$args = array(
[36] Fix | Delete
'post_type' => $fields_args['post_type'],
[37] Fix | Delete
'post_status' => 'publish',
[38] Fix | Delete
'order' => $fields_args['order_slider'],
[39] Fix | Delete
'orderby' => $fields_args['orderby_slider'],
[40] Fix | Delete
'cache_results'=>false,
[41] Fix | Delete
'suppress_filters' => false
[42] Fix | Delete
);
[43] Fix | Delete
if ($fields_args['posts_per_page_slider'] !== '') {
[44] Fix | Delete
$args['posts_per_page'] = $fields_args['posts_per_page_slider'];
[45] Fix | Delete
}
[46] Fix | Delete
Themify_Builder_Model::parseTermsQuery( $args, $fields_args[$type . '_category_slider'], $fields_args['taxonomy'] );
[47] Fix | Delete
// add offset posts
[48] Fix | Delete
if ($fields_args['offset_slider'] !== '') {
[49] Fix | Delete
$args['offset'] = $fields_args['offset_slider'];
[50] Fix | Delete
}
[51] Fix | Delete
[52] Fix | Delete
if ( $args['orderby'] === 'meta_value' && ! empty( $fields_args['meta_key_slider'] ) ) {
[53] Fix | Delete
$args['meta_key'] = $fields_args['meta_key_slider'];
[54] Fix | Delete
if ( ! empty( $fields_args['meta_key_type'] ) ) {
[55] Fix | Delete
$args['meta_type'] = $fields_args['meta_key_type'];
[56] Fix | Delete
}
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
Themify_Builder_Model::parse_query_filter( $fields_args, $args );
[60] Fix | Delete
[61] Fix | Delete
$args = apply_filters( 'themify_builder_slider_' . $type . '_query_args', $args, $fields_args );
[62] Fix | Delete
global $post;
[63] Fix | Delete
if ( isset( $post ) ){
[64] Fix | Delete
$saved_post = clone $post;
[65] Fix | Delete
}
[66] Fix | Delete
$posts = get_posts($args);
[67] Fix | Delete
$args=null;
[68] Fix | Delete
if (!empty($posts)):
[69] Fix | Delete
[70] Fix | Delete
$themify->post_module_hook = $mod_name;
[71] Fix | Delete
Themify_Builder_Model::hook_content_start( $fields_args );
[72] Fix | Delete
[73] Fix | Delete
$param_image=array(
[74] Fix | Delete
'w'=>$fields_args['img_w_slider'],
[75] Fix | Delete
'h'=>$fields_args['img_h_slider'] ,
[76] Fix | Delete
'is_slider'=>true
[77] Fix | Delete
);
[78] Fix | Delete
$attr_link_target = 'yes' === $fields_args['open_link_new_tab_slider'] ? ' target="_blank" rel="noopener"' : '';
[79] Fix | Delete
if ($fields_args['image_size_slider'] !== '') {
[80] Fix | Delete
$param_image['image_size']=$fields_args['image_size_slider'];
[81] Fix | Delete
}
[82] Fix | Delete
$isLoop=Themify_Builder::$is_loop;
[83] Fix | Delete
Themify_Builder::$is_loop=true;
[84] Fix | Delete
if(isset($themify) && $fields_args['display_slider'] === 'excerpt' && !empty($fields_args['excerpt_length'])){
[85] Fix | Delete
$temp_excerpt=$themify->excerpt_length;
[86] Fix | Delete
$themify->excerpt_length=$fields_args['excerpt_length'];
[87] Fix | Delete
$temp_disp=$themify->display_content;
[88] Fix | Delete
$themify->display_content='excerpt';
[89] Fix | Delete
add_filter('the_excerpt', 'themify_custom_except', 999);
[90] Fix | Delete
}
[91] Fix | Delete
$total_posts = count( $posts );
[92] Fix | Delete
$limit=$fields_args['visible_opt_slider'];
[93] Fix | Delete
foreach ( $posts as $index => $p ) :
[94] Fix | Delete
$post=$p;
[95] Fix | Delete
setup_postdata($post);
[96] Fix | Delete
?>
[97] Fix | Delete
[98] Fix | Delete
<?php if ( $index % $fields_args['items_per_slide'] === 0 ) : ?><div class="tf_swiper-slide"<?php if($index>=$limit):?> style="content-visibility:hidden"<?php endif;?>><?php endif; ?>
[99] Fix | Delete
[100] Fix | Delete
<div class="slide-inner-wrap"<?php if ($fields_args['margin'] !== ''): ?> style="<?php echo $fields_args['margin']; ?>"<?php endif; ?>>
[101] Fix | Delete
<?php
[102] Fix | Delete
if (($ext_link = themify_builder_get('external_link',false,false))) {
[103] Fix | Delete
$ext_link_type = 'external';
[104] Fix | Delete
} elseif (($ext_link = themify_builder_get('lightbox_link',false,false))) {
[105] Fix | Delete
$ext_link_type = 'lightbox';
[106] Fix | Delete
} else {
[107] Fix | Delete
$ext_link = themify_permalink_attr(array(),false);
[108] Fix | Delete
$ext_link=$ext_link['href'];
[109] Fix | Delete
$ext_link_type = false;
[110] Fix | Delete
}
[111] Fix | Delete
if ($fields_args['hide_feat_img_slider'] !== 'yes') {
[112] Fix | Delete
[113] Fix | Delete
// Check if there is a video url in the custom field
[114] Fix | Delete
if (($vurl = themify_builder_get('video_url',false,false))) {
[115] Fix | Delete
global $wp_embed;
[116] Fix | Delete
[117] Fix | Delete
$post_image = $wp_embed->run_shortcode('[embed]' . esc_url($vurl) . '[/embed]');
[118] Fix | Delete
} else {
[119] Fix | Delete
$post_image = themify_get_image($param_image);
[120] Fix | Delete
}
[121] Fix | Delete
if ($post_image) {
[122] Fix | Delete
?>
[123] Fix | Delete
<?php themify_before_post_image(); // Hook ?>
[124] Fix | Delete
<figure class="tf_lazy slide-image">
[125] Fix | Delete
<?php if ($fields_args['unlink_feat_img_slider'] === 'yes'): ?>
[126] Fix | Delete
<?php echo $post_image; ?>
[127] Fix | Delete
<?php else: ?>
[128] Fix | Delete
<a href="<?php echo $ext_link; ?>"
[129] Fix | Delete
<?php if ('lightbox' !== $ext_link_type && 'yes' === $fields_args['open_link_new_tab_slider']): ?> target="_blank" rel="noopener"<?php endif; ?>
[130] Fix | Delete
<?php if ('lightbox' === $ext_link_type) : ?> class="themify_lightbox" rel="prettyPhoto[slider]"<?php endif; ?>>
[131] Fix | Delete
<?php echo $post_image; ?>
[132] Fix | Delete
</a>
[133] Fix | Delete
<?php endif; ?>
[134] Fix | Delete
</figure>
[135] Fix | Delete
<?php themify_after_post_image(); // Hook ?>
[136] Fix | Delete
<?php } ?>
[137] Fix | Delete
<?php } ?>
[138] Fix | Delete
[139] Fix | Delete
<?php if ($fields_args['hide_post_title_slider'] !== 'yes' || $fields_args['display_slider'] !== 'none'): ?>
[140] Fix | Delete
<div class="slide-content tb_text_wrap">
[141] Fix | Delete
<?php if ($fields_args['hide_post_title_slider'] !== 'yes'): ?>
[142] Fix | Delete
<?php themify_before_post_title(); // Hook ?>
[143] Fix | Delete
<h3 class="slide-title">
[144] Fix | Delete
<?php if ($fields_args['unlink_post_title_slider'] === 'yes'): ?>
[145] Fix | Delete
<?php the_title(); ?>
[146] Fix | Delete
<?php else: ?>
[147] Fix | Delete
<a href="<?php echo $ext_link; ?>"
[148] Fix | Delete
<?php if ('lightbox' !== $ext_link_type && 'yes' === $fields_args['open_link_new_tab_slider']): ?> target="_blank" rel="noopener"<?php endif; ?>
[149] Fix | Delete
<?php if ('lightbox' === $ext_link_type) : ?> class="themify_lightbox" rel="prettyPhoto[slider]"<?php endif; ?>>
[150] Fix | Delete
<?php the_title(); ?>
[151] Fix | Delete
</a>
[152] Fix | Delete
<?php endif; //unlink post title ?>
[153] Fix | Delete
</h3>
[154] Fix | Delete
<?php themify_after_post_title(); // Hook ?>
[155] Fix | Delete
<?php endif; // hide post title ?>
[156] Fix | Delete
<?php if ($fields_args['hide_post_date'] !== 'yes'): ?>
[157] Fix | Delete
<time datetime="<?php the_time('o-m-d') ?>" class="post-date"><?php echo get_the_date(apply_filters('themify_loop_date', '')) ?></time>
[158] Fix | Delete
<?php endif; //post date ?>
[159] Fix | Delete
<?php
[160] Fix | Delete
// fix the issue more link doesn't output
[161] Fix | Delete
if ( $fields_args['display_slider'] !== 'none' ) {
[162] Fix | Delete
global $more;
[163] Fix | Delete
$more = 0;
[164] Fix | Delete
themify_before_post_content();
[165] Fix | Delete
if ( $fields_args['display_slider'] === 'content' ) {
[166] Fix | Delete
the_content();
[167] Fix | Delete
} else {
[168] Fix | Delete
the_excerpt();
[169] Fix | Delete
}
[170] Fix | Delete
themify_after_post_content();
[171] Fix | Delete
}
[172] Fix | Delete
?>
[173] Fix | Delete
<?php if ($type === 'testimonial'): ?>
[174] Fix | Delete
<p class="testimonial-author">
[175] Fix | Delete
<?php
[176] Fix | Delete
echo themify_builder_testimonial_author_name($p, 'yes');
[177] Fix | Delete
?>
[178] Fix | Delete
</p>
[179] Fix | Delete
<?php endif; ?>
[180] Fix | Delete
</div>
[181] Fix | Delete
<?php endif; ?>
[182] Fix | Delete
</div>
[183] Fix | Delete
[184] Fix | Delete
<?php if ( ( $index + 1 ) % $fields_args['items_per_slide'] === 0 || ( $index + 1 ) === $total_posts ) : ?></div><?php endif; ?>
[185] Fix | Delete
[186] Fix | Delete
<?php
[187] Fix | Delete
endforeach;
[188] Fix | Delete
if ( isset( $saved_post )) {
[189] Fix | Delete
$post = $saved_post;
[190] Fix | Delete
setup_postdata( $saved_post );
[191] Fix | Delete
unset($saved_post);
[192] Fix | Delete
}
[193] Fix | Delete
Themify_Builder::$is_loop=$isLoop;
[194] Fix | Delete
if(isset($temp_excerpt)){
[195] Fix | Delete
$themify->excerpt_length=$temp_excerpt;
[196] Fix | Delete
$themify->display_content=$temp_disp;
[197] Fix | Delete
remove_filter('the_excerpt', 'themify_custom_except', 999);
[198] Fix | Delete
}
[199] Fix | Delete
?>
[200] Fix | Delete
[201] Fix | Delete
<?php Themify_Builder_Model::hook_content_end( $fields_args ); ?>
[202] Fix | Delete
[203] Fix | Delete
<?php endif; ?>
[204] Fix | Delete
[205] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function