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.../public_h.../wp-conte.../plugins/themify-.../template...
File: template-archive-posts.php
<?php
[0] Fix | Delete
if (!defined('ABSPATH'))
[1] Fix | Delete
exit; // Exit if accessed directly
[2] Fix | Delete
/**
[3] Fix | Delete
* Template Archive Posts
[4] Fix | Delete
*
[5] Fix | Delete
* Access original fields: $args['mod_settings']
[6] Fix | Delete
* @author Themify
[7] Fix | Delete
*/
[8] Fix | Delete
$fields_default = array(
[9] Fix | Delete
'layout_post' => 'grid3',
[10] Fix | Delete
'masonry' => 'off',
[11] Fix | Delete
'no_found'=>'',
[12] Fix | Delete
'per_page' => get_option( 'posts_per_page' ),
[13] Fix | Delete
'pagination' => 'yes',
[14] Fix | Delete
'pagination_option' => 'numbers',
[15] Fix | Delete
'next_link' => '',
[16] Fix | Delete
'prev_link' => '',
[17] Fix | Delete
'tab_content_archive_posts' => array(),
[18] Fix | Delete
'css' => '',
[19] Fix | Delete
'animation_effect' => '',
[20] Fix | Delete
'offset'=>'',
[21] Fix | Delete
'order' => 'DESC',
[22] Fix | Delete
'orderby' => 'ID',
[23] Fix | Delete
// static query in APP
[24] Fix | Delete
'post_type' => 'post',
[25] Fix | Delete
'term_type' => 'category',
[26] Fix | Delete
'terms' => '',
[27] Fix | Delete
'tax' => '',
[28] Fix | Delete
'slug' => '',
[29] Fix | Delete
'display' => 'grid',
[30] Fix | Delete
// Slider
[31] Fix | Delete
'visible_opt_slider' => '',
[32] Fix | Delete
'mob_visible_opt_slider' => '',
[33] Fix | Delete
'tab_visible_opt_slider' => '',
[34] Fix | Delete
'auto_scroll_opt_slider' => 0,
[35] Fix | Delete
'scroll_opt_slider' => '',
[36] Fix | Delete
'speed_opt_slider' => '',
[37] Fix | Delete
'effect_slider' => 'scroll',
[38] Fix | Delete
'pause_on_hover_slider' => 'resume',
[39] Fix | Delete
'play_pause_control' => 'no',
[40] Fix | Delete
'pagination' => 'yes',
[41] Fix | Delete
'wrap_slider' => 'yes',
[42] Fix | Delete
'show_nav_slider' => 'yes',
[43] Fix | Delete
'show_arrow_slider' => 'yes',
[44] Fix | Delete
'show_arrow_buttons_vertical' => '',
[45] Fix | Delete
'left_margin_slider' => '',
[46] Fix | Delete
'right_margin_slider' => '',
[47] Fix | Delete
'height_slider' => 'variable',
[48] Fix | Delete
);
[49] Fix | Delete
if (isset($args['mod_settings']['tab_content_archive_posts']['image']['val']['appearance_image'])) {
[50] Fix | Delete
$args['mod_settings']['tab_content_archive_posts']['image']['val']['appearance_image'] = self::get_checkbox_data($args['mod_settings']['tab_content_archive_posts']['image']['val']['appearance_image']);
[51] Fix | Delete
}
[52] Fix | Delete
$fields_args = wp_parse_args($args['mod_settings'], $fields_default);
[53] Fix | Delete
unset($args['mod_settings']);
[54] Fix | Delete
$fields_default=null;
[55] Fix | Delete
if ( $fields_args['display'] === 'slider' ) {
[56] Fix | Delete
$fields_args['layout_post'] = '';
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
$mod_name=$args['mod_name'];
[60] Fix | Delete
$element_id =$args['module_ID'];
[61] Fix | Delete
$builder_id=$args['builder_id'];
[62] Fix | Delete
$container_class = apply_filters('themify_builder_module_classes', array(
[63] Fix | Delete
'module',
[64] Fix | Delete
'module-' . $mod_name,
[65] Fix | Delete
$element_id,
[66] Fix | Delete
$fields_args['css'],
[67] Fix | Delete
isset($fields_args['tab_content_archive_posts']['image']['val']['appearance_image']) ? 'module-image '.$fields_args['tab_content_archive_posts']['image']['val']['appearance_image'] : ''
[68] Fix | Delete
), $mod_name,$element_id, $fields_args );
[69] Fix | Delete
[70] Fix | Delete
if(!empty($fields_args['global_styles']) && Themify_Builder::$frontedit_active===false){
[71] Fix | Delete
$container_class[] = $fields_args['global_styles'];
[72] Fix | Delete
}
[73] Fix | Delete
elseif(Tbp_Public::$isTemplatePage===true || (isset($_POST['pageId']) && Themify_Builder::$frontedit_active===true)){
[74] Fix | Delete
Tbp_Utils::get_actual_query();
[75] Fix | Delete
}
[76] Fix | Delete
$paged = $fields_args['pagination'] === 'yes' || $fields_args['pagination'] === 'on' ? self::get_paged_query() : 1;
[77] Fix | Delete
[78] Fix | Delete
$per_page = (int)$fields_args['per_page'];
[79] Fix | Delete
$post_type = get_query_var('post_type');
[80] Fix | Delete
if ( Tbp_Public::$isTemplatePage === true || empty( $post_type ) ) {
[81] Fix | Delete
$post_type = 'post';
[82] Fix | Delete
}
[83] Fix | Delete
[84] Fix | Delete
if ( isset( $fields_args['builder_content'] ) && Tbp_Utils::$isLoop === true ) {
[85] Fix | Delete
$fields_args['builder_id'] = $args['builder_id'];
[86] Fix | Delete
unset( $fields_args['tab_content_archive_posts'] );
[87] Fix | Delete
$isAPP = true;
[88] Fix | Delete
if ( is_string( $fields_args['builder_content'] ) ) {
[89] Fix | Delete
$fields_args['builder_content']= json_decode($fields_args['builder_content'],true);
[90] Fix | Delete
}
[91] Fix | Delete
$container_class[] = 'themify_builder_content-' . str_replace( 'tb_', '', $args['module_ID'] );
[92] Fix | Delete
} else {
[93] Fix | Delete
$isAPP = null;
[94] Fix | Delete
}
[95] Fix | Delete
if($fields_args['orderby']==='id'){
[96] Fix | Delete
$fields_args['orderby']='ID';
[97] Fix | Delete
}
[98] Fix | Delete
$query_args = array(
[99] Fix | Delete
'post_type' => $post_type,
[100] Fix | Delete
'post_status' => 'publish',
[101] Fix | Delete
'ptb_disable'=>true,
[102] Fix | Delete
'order' => $fields_args['order'],
[103] Fix | Delete
'orderby' => $fields_args['orderby'],
[104] Fix | Delete
'posts_per_page' => $per_page,
[105] Fix | Delete
'paged' => $paged,
[106] Fix | Delete
'offset' => ( ( $paged - 1 ) * $per_page ),
[107] Fix | Delete
);
[108] Fix | Delete
if ( true === Themify_Builder::$frontedit_active && isset( $_POST['pageId'] ) ) {
[109] Fix | Delete
$query_args['post__not_in'] = array( $_POST['pageId'] );
[110] Fix | Delete
} else {
[111] Fix | Delete
if ( false !== ( $id = get_the_ID() ) && is_single( $id ) ) {
[112] Fix | Delete
$query_args['post__not_in'] = array( $id );
[113] Fix | Delete
}
[114] Fix | Delete
}
[115] Fix | Delete
if($fields_args['offset']!==''){
[116] Fix | Delete
$query_args['offset']+=(int)$fields_args['offset'];
[117] Fix | Delete
}
[118] Fix | Delete
[119] Fix | Delete
if( ! empty( $fields_args['meta_key'] ) && ($query_args['orderby']==='meta_value' || $query_args['orderby']==='meta_value_num')) {
[120] Fix | Delete
$query_args[ 'meta_key' ] = $fields_args['meta_key'];
[121] Fix | Delete
}
[122] Fix | Delete
if ( $isAPP===true && Tbp_Public::$is_archive===false) {
[123] Fix | Delete
// on non-archive pages, AAP module acts like Post module, displays posts from a custom query
[124] Fix | Delete
$query_args['ignore_sticky_posts'] = true;
[125] Fix | Delete
$query_args['post_type'] = $fields_args['post_type'];
[126] Fix | Delete
if ( $fields_args['term_type'] === 'post_slug' && $fields_args['slug']!=='' ) {
[127] Fix | Delete
$query_args['post__in'] = Themify_Builder_Model::parse_slug_to_ids( $fields_args['slug'], $query_args['post_type'] );
[128] Fix | Delete
} else {
[129] Fix | Delete
Themify_Builder_Model::parseTermsQuery($query_args,$fields_args['terms'],$fields_args['tax'] );
[130] Fix | Delete
}
[131] Fix | Delete
} else {
[132] Fix | Delete
if ('related-posts' === $mod_name) {
[133] Fix | Delete
$query_args['tax_query'] = array(
[134] Fix | Delete
array(
[135] Fix | Delete
'taxonomy' => $fields_args['term_type'],
[136] Fix | Delete
'field' => 'id',
[137] Fix | Delete
'terms' => $fields_args['term_id']
[138] Fix | Delete
)
[139] Fix | Delete
);
[140] Fix | Delete
}else if ( is_category() || is_tag() || is_tax() ) {
[141] Fix | Delete
$obj = get_queried_object();
[142] Fix | Delete
if ( !empty( $obj ) ) {
[143] Fix | Delete
if(is_category()){
[144] Fix | Delete
$query_args['cat'] = $obj->term_id;
[145] Fix | Delete
}
[146] Fix | Delete
elseif (is_tag() ) {
[147] Fix | Delete
$query_args['tag_id'] = $obj->term_id;
[148] Fix | Delete
}
[149] Fix | Delete
elseif(is_tax()){
[150] Fix | Delete
$tax = get_taxonomy($obj->taxonomy);
[151] Fix | Delete
if(!empty($tax)){
[152] Fix | Delete
$query_args['tax_query']=array(
[153] Fix | Delete
array(
[154] Fix | Delete
'taxonomy' => $obj->taxonomy,
[155] Fix | Delete
'field' => 'id',
[156] Fix | Delete
'terms' => $obj->term_id
[157] Fix | Delete
)
[158] Fix | Delete
);
[159] Fix | Delete
$query_args['post_type']=$tax->object_type;
[160] Fix | Delete
}
[161] Fix | Delete
}
[162] Fix | Delete
}
[163] Fix | Delete
}
[164] Fix | Delete
elseif(Tbp_Public::$isTemplatePage===false){
[165] Fix | Delete
global $wp_query;
[166] Fix | Delete
if(is_array($wp_query->query)){
[167] Fix | Delete
$query_args = $query_args+$wp_query->query;
[168] Fix | Delete
}
[169] Fix | Delete
}
[170] Fix | Delete
else{
[171] Fix | Delete
$query_args['ignore_sticky_posts']=true;
[172] Fix | Delete
}
[173] Fix | Delete
[174] Fix | Delete
}
[175] Fix | Delete
$container_props = apply_filters('themify_builder_module_container_props', array(
[176] Fix | Delete
'class' => implode(' ', $container_class),
[177] Fix | Delete
), $fields_args, $mod_name,$element_id);
[178] Fix | Delete
$the_query = new WP_Query( $query_args );
[179] Fix | Delete
$query_args=$args=null;
[180] Fix | Delete
?>
[181] Fix | Delete
<!-- <?php echo $mod_name?> module -->
[182] Fix | Delete
<div <?php echo self::get_element_attributes( self::sticky_element_props( $container_props, $fields_args ) ); ?>>
[183] Fix | Delete
<?php
[184] Fix | Delete
do_action('themify_builder_background_styling',$builder_id,array('styling'=>$fields_args,'mod_name'=>$mod_name),$element_id,'module');
[185] Fix | Delete
$container_props=$container_class=null;
[186] Fix | Delete
if ( $the_query->have_posts() ) :
[187] Fix | Delete
[188] Fix | Delete
$class=array('builder-posts-wrap','loops-wrapper');
[189] Fix | Delete
if($post_type !== 'post'){
[190] Fix | Delete
$class[]= join( ' ', (array) $post_type );
[191] Fix | Delete
}
[192] Fix | Delete
[193] Fix | Delete
if ( $fields_args['display'] === 'slider' ) {
[194] Fix | Delete
$margin = '';
[195] Fix | Delete
if ( $fields_args['left_margin_slider'] !== '' ) {
[196] Fix | Delete
$margin = 'margin-left:'.$fields_args['left_margin_slider'].'px;';
[197] Fix | Delete
}
[198] Fix | Delete
if($fields_args['right_margin_slider']!==''){
[199] Fix | Delete
$margin .= 'margin-right:'.$fields_args['right_margin_slider'].'px';
[200] Fix | Delete
}
[201] Fix | Delete
$container_inner = array(
[202] Fix | Delete
'data-visible' => $fields_args['visible_opt_slider'],
[203] Fix | Delete
'data-tab-visible' => $fields_args['tab_visible_opt_slider'],
[204] Fix | Delete
'data-tbreakpoints' => themify_get_breakpoints('tablet_landscape')[1],
[205] Fix | Delete
'data-mob-visible' => $fields_args['mob_visible_opt_slider'],
[206] Fix | Delete
'data-mbreakpoints' => themify_get_breakpoints('mobile'),
[207] Fix | Delete
'data-scroll' => $fields_args['scroll_opt_slider'],
[208] Fix | Delete
'data-speed' => $fields_args['speed_opt_slider'] === 'slow' ? 4 : ($fields_args['speed_opt_slider'] === 'fast' ? '.5' : 1),
[209] Fix | Delete
'data-wrapvar' => $fields_args['wrap_slider'] !== 'no' ? 1 : 0,
[210] Fix | Delete
'data-slider_nav' => $fields_args['show_arrow_slider'] === 'yes' ? 1 : 0,
[211] Fix | Delete
'data-pager' => $fields_args['show_nav_slider'] === 'yes' ? 1 : 0,
[212] Fix | Delete
'data-effect' => $fields_args['effect_slider'],
[213] Fix | Delete
'data-height' => $fields_args['height_slider'],
[214] Fix | Delete
);
[215] Fix | Delete
if ($container_inner['data-slider_nav'] === 1 && $fields_args['show_arrow_buttons_vertical'] === 'vertical') {
[216] Fix | Delete
$container_inner['data-nav_out'] = 1;
[217] Fix | Delete
$class[] = ' themify_builder_slider_vertical';
[218] Fix | Delete
}
[219] Fix | Delete
if ($fields_args['auto_scroll_opt_slider'] && $fields_args['auto_scroll_opt_slider'] !== 'off') {
[220] Fix | Delete
$container_inner['data-auto'] = $fields_args['auto_scroll_opt_slider']*1000;
[221] Fix | Delete
$container_inner['data-pause_hover'] = $fields_args['pause_on_hover_slider'] === 'resume' ? 1 : 0;
[222] Fix | Delete
$container_inner['data-controller'] = $fields_args['play_pause_control'] === 'yes' ? 1 : 0;
[223] Fix | Delete
}
[224] Fix | Delete
} else {
[225] Fix | Delete
if($fields_args['masonry'] === 'yes' && in_array($fields_args['layout_post'], array('grid2', 'grid3', 'grid4'), true)){
[226] Fix | Delete
$class[]='tbp_masonry';
[227] Fix | Delete
$class[]='masonry';
[228] Fix | Delete
}
[229] Fix | Delete
}
[230] Fix | Delete
[231] Fix | Delete
$class[]=apply_filters('themify_builder_module_loops_wrapper', $fields_args['layout_post'],$fields_args,$mod_name);//deprecated backward compatibility
[232] Fix | Delete
$class=apply_filters( 'themify_loops_wrapper_class', $class,$post_type,$fields_args['layout_post'],'builder',$fields_args,$mod_name);
[233] Fix | Delete
[234] Fix | Delete
$class[]='tf_clear';
[235] Fix | Delete
$class[]='tf_clearfix';
[236] Fix | Delete
$container_props = apply_filters('themify_builder_module_container_props', self::parse_animation_effect($fields_args,array(
[237] Fix | Delete
'class' => implode(' ',$class)
[238] Fix | Delete
)), $post_type,$fields_args['layout_post'],$fields_args,$mod_name);
[239] Fix | Delete
[240] Fix | Delete
if(Themify_Builder::$frontedit_active===false){
[241] Fix | Delete
$container_props['data-lazy']=1;
[242] Fix | Delete
}
[243] Fix | Delete
unset($class);
[244] Fix | Delete
[245] Fix | Delete
Tbp_Utils::disable_ptb_loop();
[246] Fix | Delete
$isLoop = $ThemifyBuilder->in_the_loop === true;
[247] Fix | Delete
$ThemifyBuilder->in_the_loop = true;
[248] Fix | Delete
?>
[249] Fix | Delete
<?php if ( ! empty( $fields_args['heading'] ) ) : ?>
[250] Fix | Delete
<h2><?php echo $fields_args['heading']; ?></h2>
[251] Fix | Delete
<?php endif; ?>
[252] Fix | Delete
<div <?php echo self::get_element_attributes($container_props); unset( $container_props ); ?>>
[253] Fix | Delete
[254] Fix | Delete
<?php if ( $fields_args['display'] === 'slider' ) : ?>
[255] Fix | Delete
<div
[256] Fix | Delete
class="themify_builder_slider tf_carousel swiper-container tf_rel tf_overflow"
[257] Fix | Delete
<?php if ( Themify_Builder::$frontedit_active === false ) : ?> data-lazy="1"<?php endif; ?>
[258] Fix | Delete
<?php echo self::get_element_attributes( $container_inner ); ?>
[259] Fix | Delete
>
[260] Fix | Delete
<div class="swiper-wrapper tf_lazy tf_rel tf_w tf_h tf_textc">
[261] Fix | Delete
<?php endif; ?>
[262] Fix | Delete
[263] Fix | Delete
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
[264] Fix | Delete
[265] Fix | Delete
<?php if ( $fields_args['display'] === 'slider' ) : ?>
[266] Fix | Delete
<div class="swiper-slide">
[267] Fix | Delete
<div class="slide-inner-wrap"<?php if ( ! empty( $margin ) ) : ?> style="<?php echo $margin; ?>"<?php endif; ?>>
[268] Fix | Delete
<?php endif; ?>
[269] Fix | Delete
[270] Fix | Delete
<?php themify_post_before(); // hook ?>
[271] Fix | Delete
[272] Fix | Delete
<article itemscope itemtype="http://schema.org/BlogPosting" id="post-<?php the_ID(); ?>" <?php post_class('post tf_clearfix'); ?>>
[273] Fix | Delete
<?php
[274] Fix | Delete
themify_post_start(); // hook
[275] Fix | Delete
if($isAPP===true){
[276] Fix | Delete
self::retrieve_template('partials/advanched-archive.php', $fields_args);
[277] Fix | Delete
}
[278] Fix | Delete
else{
[279] Fix | Delete
self::retrieve_template('partials/simple-archive.php', $fields_args);
[280] Fix | Delete
}
[281] Fix | Delete
themify_post_end(); // hook
[282] Fix | Delete
?>
[283] Fix | Delete
</article>
[284] Fix | Delete
[285] Fix | Delete
<?php themify_post_after(); // hook ?>
[286] Fix | Delete
[287] Fix | Delete
<?php if ( $fields_args['display'] === 'slider' ) : ?>
[288] Fix | Delete
</div>
[289] Fix | Delete
</div><!-- .swiper-slide -->
[290] Fix | Delete
<?php endif; ?>
[291] Fix | Delete
[292] Fix | Delete
<?php endwhile; wp_reset_postdata(); ?>
[293] Fix | Delete
[294] Fix | Delete
<?php if ( $fields_args['display'] === 'slider' ) : ?>
[295] Fix | Delete
</div><!-- .swiper-wrapper -->
[296] Fix | Delete
</div><!-- .themify_builder_slider -->
[297] Fix | Delete
<?php endif; ?>
[298] Fix | Delete
[299] Fix | Delete
</div>
[300] Fix | Delete
[301] Fix | Delete
<?php
[302] Fix | Delete
$ThemifyBuilder->in_the_loop = $isLoop;
[303] Fix | Delete
if ( $fields_args['display'] === 'grid' && $fields_args['pagination'] === 'yes' ) {
[304] Fix | Delete
self::retrieve_template('partials/pagination.php', array(
[305] Fix | Delete
'pagination_option' => $fields_args['pagination_option'],
[306] Fix | Delete
'next_link' => $fields_args['next_link'],
[307] Fix | Delete
'prev_link' => $fields_args['prev_link'],
[308] Fix | Delete
'query' => $the_query
[309] Fix | Delete
));
[310] Fix | Delete
}
[311] Fix | Delete
?>
[312] Fix | Delete
<?php else:?>
[313] Fix | Delete
<?php echo $fields_args['no_found'];?>
[314] Fix | Delete
<?php endif; ?>
[315] Fix | Delete
[316] Fix | Delete
</div><!-- /<?php echo $mod_name?> module -->
[317] Fix | Delete
[318] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function