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-blog.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Template Post
[2] Fix | Delete
* This template can be overridden by copying it to your child_theme_folder/themify-builder/template-blog.php.
[3] Fix | Delete
* Access original fields: $args['mod_settings']
[4] Fix | Delete
* @author Themify
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
defined('ABSPATH') || exit;
[8] Fix | Delete
[9] Fix | Delete
$mod_name = $args['mod_name'];
[10] Fix | Delete
$builder_id = $args['builder_id'];
[11] Fix | Delete
$element_id = $args['module_ID'];
[12] Fix | Delete
$fields_args=$args['mod_settings']+array(
[13] Fix | Delete
'mod_title_' . $mod_name => '',
[14] Fix | Delete
'layout_' . $mod_name => 'grid4',
[15] Fix | Delete
'post_type_' . $mod_name => $mod_name,
[16] Fix | Delete
'term_type' => 'category', // Query By option
[17] Fix | Delete
'type_query_' . $mod_name => 'category',
[18] Fix | Delete
'category_' . $mod_name => '',
[19] Fix | Delete
'query_slug_' . $mod_name => '',
[20] Fix | Delete
'sticky_' . $mod_name => 'no',
[21] Fix | Delete
'post_per_page_' . $mod_name => '',
[22] Fix | Delete
'offset_' . $mod_name => '',
[23] Fix | Delete
'order_' . $mod_name => 'desc',
[24] Fix | Delete
'orderby_' . $mod_name => 'date',
[25] Fix | Delete
'meta_key_' . $mod_name => '',
[26] Fix | Delete
'display_' . $mod_name => 'content',
[27] Fix | Delete
'excerpt_length_' . $mod_name => '',
[28] Fix | Delete
'hide_feat_img_' . $mod_name => 'no',
[29] Fix | Delete
'image_size_' . $mod_name => 'large',
[30] Fix | Delete
'img_width_' . $mod_name => '',
[31] Fix | Delete
'img_height_' . $mod_name => '',
[32] Fix | Delete
'unlink_feat_img_' . $mod_name => 'no',
[33] Fix | Delete
'hide_post_title_' . $mod_name => 'no',
[34] Fix | Delete
'title_tag_' . $mod_name => 'h2',
[35] Fix | Delete
'unlink_post_title_' . $mod_name => 'no',
[36] Fix | Delete
'hide_post_date_' . $mod_name => 'no',
[37] Fix | Delete
'hide_post_meta_' . $mod_name => 'no',
[38] Fix | Delete
'hide_author_' . $mod_name => '',
[39] Fix | Delete
'hide_category_' . $mod_name => '',
[40] Fix | Delete
'hide_comment_' . $mod_name => '',
[41] Fix | Delete
'hide_page_nav_' . $mod_name => 'yes',
[42] Fix | Delete
'nav_type' => 'standard',
[43] Fix | Delete
'animation_effect' => '',
[44] Fix | Delete
'hide_empty' => 'no',
[45] Fix | Delete
'css_' . $mod_name => '',
[46] Fix | Delete
'auto_fullwidth_' . $mod_name => false
[47] Fix | Delete
);
[48] Fix | Delete
[49] Fix | Delete
$is_ajax_filter = isset($_POST['action']) && $_POST['action'] === 'themify_ajax_load_more';
[50] Fix | Delete
if (true === $is_ajax_filter && isset($_POST['tax'])) {
[51] Fix | Delete
$cat =$fields_args['type_query_'.$mod_name];
[52] Fix | Delete
$fields_args[$cat . '_' . $mod_name] = (int)$_POST['tax'];
[53] Fix | Delete
}
[54] Fix | Delete
elseif (isset($fields_args['category_' . $mod_name])) {
[55] Fix | Delete
$fields_args['category_' . $mod_name] = self::get_param_value($fields_args['category_' . $mod_name]);
[56] Fix | Delete
}
[57] Fix | Delete
if ($fields_args['layout_' . $mod_name] === '') {
[58] Fix | Delete
$fields_args['layout_' . $mod_name] = 'grid4';
[59] Fix | Delete
}
[60] Fix | Delete
$container_class = apply_filters('themify_builder_module_classes', array(
[61] Fix | Delete
'module',
[62] Fix | Delete
'module-' . $mod_name,
[63] Fix | Delete
$element_id,
[64] Fix | Delete
$fields_args['css_' . $mod_name]
[65] Fix | Delete
), $mod_name, $element_id, $fields_args);
[66] Fix | Delete
[67] Fix | Delete
if (!empty($fields_args['global_styles']) && Themify_Builder::$frontedit_active === false) {
[68] Fix | Delete
$container_class[] = $fields_args['global_styles'];
[69] Fix | Delete
}
[70] Fix | Delete
if (!empty($fields_args['auto_fullwidth_' . $mod_name]) && $fields_args['auto_fullwidth_' . $mod_name]) {
[71] Fix | Delete
$container_class[] = 'tb_fullwidth_image';
[72] Fix | Delete
}
[73] Fix | Delete
[74] Fix | Delete
$container_props = apply_filters('themify_builder_module_container_props', self::parse_animation_effect($fields_args, array(
[75] Fix | Delete
'class' => implode(' ', $container_class),
[76] Fix | Delete
)), $fields_args, $mod_name, $element_id);
[77] Fix | Delete
[78] Fix | Delete
if (true === $is_ajax_filter && isset($_POST['page'])) {
[79] Fix | Delete
$p = (int) $_POST['page'];
[80] Fix | Delete
} else {
[81] Fix | Delete
$p = self::get_paged_query();
[82] Fix | Delete
}
[83] Fix | Delete
[84] Fix | Delete
$order = true === $is_ajax_filter && isset($_POST['order']) ? sanitize_text_field($_POST['order']) : $fields_args['order_' . $mod_name];
[85] Fix | Delete
$orderby = true === $is_ajax_filter && isset($_POST['orderby']) ? sanitize_text_field($_POST['orderby']) : $fields_args['orderby_' . $mod_name];
[86] Fix | Delete
$meta_key = $fields_args['meta_key_' . $mod_name];
[87] Fix | Delete
$limit = $fields_args['post_per_page_' . $mod_name];
[88] Fix | Delete
if (empty($limit)) {
[89] Fix | Delete
$limit = get_option('posts_per_page');
[90] Fix | Delete
}
[91] Fix | Delete
$mod_name_query = isset($fields_args['term_type']) && $fields_args['term_type'] === 'post_slug' ? $fields_args['term_type'] : $fields_args['type_query_' . $mod_name];
[92] Fix | Delete
$offset = $fields_args['offset_' . $mod_name];
[93] Fix | Delete
$args = array(
[94] Fix | Delete
'post_status' => 'publish',
[95] Fix | Delete
'posts_per_page' => $limit,
[96] Fix | Delete
'ptb_disable' => true,
[97] Fix | Delete
'order' => $order,
[98] Fix | Delete
'orderby' => $orderby,
[99] Fix | Delete
'paged' => $p,
[100] Fix | Delete
'post_type' => $fields_args['post_type_' . $mod_name],
[101] Fix | Delete
'ignore_sticky_posts' => true
[102] Fix | Delete
);
[103] Fix | Delete
[104] Fix | Delete
if ('all' === $fields_args['term_type']) {
[105] Fix | Delete
if ($fields_args["sticky_{$mod_name}"] === 'yes') {
[106] Fix | Delete
$args['ignore_sticky_posts'] = false;
[107] Fix | Delete
}
[108] Fix | Delete
$query_taxonomy = $mod_name !== 'post' ? $mod_name . '-category' : 'category';
[109] Fix | Delete
}
[110] Fix | Delete
elseif ('post_slug'!== $fields_args['term_type']) {
[111] Fix | Delete
$terms = $mod_name === 'post' && isset($fields_args["{$mod_name_query}_post"]) ? $fields_args["{$mod_name_query}_post"] : $fields_args['category_' . $mod_name];
[112] Fix | Delete
$query_taxonomy = $mod_name !== 'post' ? $mod_name . '-category' : $mod_name_query;
[113] Fix | Delete
Themify_Builder_Model::parseTermsQuery($args, $terms, $query_taxonomy);
[114] Fix | Delete
$mod_name_query = $query_taxonomy;
[115] Fix | Delete
[116] Fix | Delete
}
[117] Fix | Delete
elseif (!empty($fields_args['query_slug_' . $mod_name])) {
[118] Fix | Delete
$args['post__in'] = Themify_Builder_Model::parse_slug_to_ids($fields_args['query_slug_' . $mod_name], $args['post_type']);
[119] Fix | Delete
}
[120] Fix | Delete
[121] Fix | Delete
/* backward compatibility, since Sep 2022 */
[122] Fix | Delete
if ($orderby === 'meta_value_num') {
[123] Fix | Delete
$orderby = 'meta_value';
[124] Fix | Delete
$fields_args['meta_key_type'] = 'NUMERIC';
[125] Fix | Delete
}
[126] Fix | Delete
/* end backward compatibility */
[127] Fix | Delete
[128] Fix | Delete
if (!empty($meta_key) && $orderby === 'meta_value') {
[129] Fix | Delete
$args['meta_key'] = $meta_key;
[130] Fix | Delete
if (!empty($fields_args['meta_key_type'])) {
[131] Fix | Delete
$args['meta_type'] = $fields_args['meta_key_type'];
[132] Fix | Delete
}
[133] Fix | Delete
}
[134] Fix | Delete
[135] Fix | Delete
// add offset posts
[136] Fix | Delete
if ($offset !== '') {
[137] Fix | Delete
$args['offset'] = (($p - 1) * $limit) + $offset;
[138] Fix | Delete
}
[139] Fix | Delete
// Exclude the current post
[140] Fix | Delete
if ($mod_name === 'post' && !isset($args['post__in']) && false !== ($id = get_the_ID()) && (Themify_Builder::$is_loop===true || is_singular($id))) {
[141] Fix | Delete
$args['post__not_in'] = array($id);
[142] Fix | Delete
}
[143] Fix | Delete
[144] Fix | Delete
Themify_Builder_Model::parse_query_filter($fields_args, $args);
[145] Fix | Delete
$post_filter_enabled = isset($fields_args[$mod_name . '_filter']) ? $fields_args[$mod_name . '_filter'] : (isset($fields_args['post_filter']) ? $fields_args['post_filter'] : false);
[146] Fix | Delete
$post_filter_enabled = !empty($post_filter_enabled) && $post_filter_enabled !== 'no';
[147] Fix | Delete
$ajax_filter_enabled = false;
[148] Fix | Delete
if (true === $post_filter_enabled && $fields_args['layout_' . $mod_name] !== 'auto_tiles') {
[149] Fix | Delete
$ajax_filter_enabled = isset($fields_args['ajax_filter']) && $fields_args['ajax_filter'] === 'yes';
[150] Fix | Delete
if ($ajax_filter_enabled) {
[151] Fix | Delete
/* in Ajax post filters, disable some query args */
[152] Fix | Delete
unset($args['post__in']);
[153] Fix | Delete
set_query_var('tf_ajax_filter', true);
[154] Fix | Delete
}
[155] Fix | Delete
}
[156] Fix | Delete
$args = apply_filters("themify_builder_module_{$mod_name}_query_args", $args, $fields_args);
[157] Fix | Delete
if (isset($query_taxonomy)) {
[158] Fix | Delete
set_query_var('tf_query_tax', $query_taxonomy);
[159] Fix | Delete
}
[160] Fix | Delete
$the_query = self::query($args);
[161] Fix | Delete
$posts = $the_query->posts;
[162] Fix | Delete
[163] Fix | Delete
if (empty($posts) && $fields_args['hide_empty'] === 'yes' && Themify_Builder::$frontedit_active === false) {
[164] Fix | Delete
return;
[165] Fix | Delete
}
[166] Fix | Delete
[167] Fix | Delete
[168] Fix | Delete
Themify_Builder_Model::hook_content_start($fields_args);
[169] Fix | Delete
self::sticky_element_props($container_props,$fields_args);
[170] Fix | Delete
?>
[171] Fix | Delete
<!-- module post -->
[172] Fix | Delete
<div <?php echo themify_get_element_attributes($container_props); ?>>
[173] Fix | Delete
<?php
[174] Fix | Delete
$container_props = $container_props = null;
[175] Fix | Delete
echo Themify_Builder_Component_Module::get_module_title($fields_args, 'mod_title_' . $mod_name);
[176] Fix | Delete
[177] Fix | Delete
// The Query
[178] Fix | Delete
do_action('themify_builder_before_template_content_render');
[179] Fix | Delete
[180] Fix | Delete
$class = array('builder-posts-wrap', 'loops-wrapper');
[181] Fix | Delete
if (!empty($fields_args['post_type_' . $mod_name]) && $fields_args['post_type_' . $mod_name] !== 'post') {
[182] Fix | Delete
$class[] = $fields_args['post_type_' . $mod_name];
[183] Fix | Delete
}
[184] Fix | Delete
if (($fields_args['layout_' . $mod_name] === 'auto_tiles' || in_array('auto_tiles', $class, true)) && !in_array('masonry', $class, true)) {
[185] Fix | Delete
$count = count($posts);
[186] Fix | Delete
if ($count === 5 || $count === 6) {
[187] Fix | Delete
$class[] = 'tf_tiles_' . $count;
[188] Fix | Delete
} else {
[189] Fix | Delete
$class[] = 'tf_tiles_more';
[190] Fix | Delete
}
[191] Fix | Delete
}
[192] Fix | Delete
$class[] = apply_filters('themify_builder_module_loops_wrapper', $fields_args['layout_' . $mod_name], $fields_args, $mod_name); //deprecated backward compatibility
[193] Fix | Delete
$posts_in_lightbox = isset( $fields_args['lbpost'] ) && $fields_args['lbpost'] === 'yes';
[194] Fix | Delete
$fields_args['title_tag_' . $mod_name] = esc_attr( $fields_args['title_tag_' . $mod_name] );
[195] Fix | Delete
global $themify;
[196] Fix | Delete
if (isset($themify) && !empty($posts)) {
[197] Fix | Delete
// save a copy
[198] Fix | Delete
$themify_save = clone $themify;
[199] Fix | Delete
// override $themify object
[200] Fix | Delete
$themify->hide_image = $fields_args['hide_feat_img_' . $mod_name];
[201] Fix | Delete
$themify->unlink_image = $fields_args['unlink_feat_img_' . $mod_name];
[202] Fix | Delete
$themify->hide_title = $fields_args['hide_post_title_' . $mod_name];
[203] Fix | Delete
$themify->themify_post_title_tag = $fields_args['title_tag_' . $mod_name];
[204] Fix | Delete
$themify->width = $fields_args['img_width_' . $mod_name];
[205] Fix | Delete
$themify->height = $fields_args['img_height_' . $mod_name];
[206] Fix | Delete
$themify->image_size = $fields_args['image_size_' . $mod_name];
[207] Fix | Delete
$themify->unlink_title = $fields_args['unlink_post_title_' . $mod_name];
[208] Fix | Delete
$themify->display_content = $fields_args['display_' . $mod_name];
[209] Fix | Delete
if ($fields_args['display_' . $mod_name] === 'excerpt' && !empty($fields_args['excerpt_length_' . $mod_name])) {
[210] Fix | Delete
if ( Themify_Builder::$frontedit_active === true || Themify_Builder_Model::is_front_builder_activate() ) {
[211] Fix | Delete
/* combat WP's post-excerpt block filtering excerpt_length on REST_REQUEST */
[212] Fix | Delete
remove_all_filters( 'excerpt_length' );
[213] Fix | Delete
add_filter( 'excerpt_length', 'themify_custom_except_length', 999 );
[214] Fix | Delete
}
[215] Fix | Delete
$themify->excerpt_length = $fields_args['excerpt_length_' . $mod_name];
[216] Fix | Delete
add_filter('the_excerpt', 'themify_custom_except', 999);
[217] Fix | Delete
}
[218] Fix | Delete
$themify->hide_date = $fields_args['hide_post_date_' . $mod_name];
[219] Fix | Delete
$themify->hide_meta = $fields_args['hide_post_meta_' . $mod_name];
[220] Fix | Delete
if ($fields_args['hide_post_meta_' . $mod_name] !== 'yes') {
[221] Fix | Delete
if ($fields_args['hide_author_' . $mod_name] === 'yes') {
[222] Fix | Delete
$themify->hide_meta_author = 'yes';
[223] Fix | Delete
}
[224] Fix | Delete
if ($fields_args['hide_category_' . $mod_name] === 'yes') {
[225] Fix | Delete
$themify->hide_meta_category = 'yes';
[226] Fix | Delete
$themify->hide_meta_tag = 'yes';
[227] Fix | Delete
}
[228] Fix | Delete
if ($fields_args['hide_comment_' . $mod_name] === 'yes') {
[229] Fix | Delete
$themify->hide_meta_comment = 'yes';
[230] Fix | Delete
}
[231] Fix | Delete
}
[232] Fix | Delete
$themify->post_layout = $fields_args['layout_' . $mod_name];
[233] Fix | Delete
if ('auto_tiles' === $themify->post_layout || !empty($fields_args[$mod_name . '_content_layout']) && in_array($fields_args[$mod_name . '_content_layout'], array('polaroid', 'flip'), true)) {
[234] Fix | Delete
$themify->media_position = 'above';
[235] Fix | Delete
}
[236] Fix | Delete
if ('post' === $mod_name) {
[237] Fix | Delete
$themify->post_module_hook = $mod_name;
[238] Fix | Delete
if (isset($query_taxonomy)) {
[239] Fix | Delete
$themify->post_module_tax = $query_taxonomy;
[240] Fix | Delete
}
[241] Fix | Delete
if (isset($fields_args[$mod_name . '_content_layout'])) {
[242] Fix | Delete
$themify->post_layout_type = $fields_args[$mod_name . '_content_layout'];
[243] Fix | Delete
}
[244] Fix | Delete
}
[245] Fix | Delete
$themify->lightboxed_permalink = $posts_in_lightbox;
[246] Fix | Delete
}
[247] Fix | Delete
if (true === $post_filter_enabled && isset($query_taxonomy) && function_exists('themify_masonry_filter')) {
[248] Fix | Delete
if (isset($themify)) {
[249] Fix | Delete
$themify->post_filter = 'yes';
[250] Fix | Delete
}
[251] Fix | Delete
[252] Fix | Delete
$filter_args = array(
[253] Fix | Delete
'query_taxonomy' => $query_taxonomy,
[254] Fix | Delete
'query_category' => '0',
[255] Fix | Delete
'el_id' => $element_id
[256] Fix | Delete
);
[257] Fix | Delete
if (isset($fields_args['filter_hashtag']) && $fields_args['filter_hashtag'] === 'yes') {
[258] Fix | Delete
$filter_args['hash_tag'] = true;
[259] Fix | Delete
}
[260] Fix | Delete
if (true === $ajax_filter_enabled) {
[261] Fix | Delete
$filter_args['ajax_filter'] = 'yes';
[262] Fix | Delete
$filter_args['ajax_filter_id'] = $builder_id;
[263] Fix | Delete
$filter_args['ajax_filter_paged'] = $args['paged'];
[264] Fix | Delete
$filter_args['ajax_filter_limit'] = $args['posts_per_page'];
[265] Fix | Delete
$fields_args['nav_type'] = 'ajax';
[266] Fix | Delete
$cat_filter = isset($fields_args['ajax_filter_categories']) ? $fields_args['ajax_filter_categories'] : 'exclude';
[267] Fix | Delete
if (('exclude' === $cat_filter || 'include' === $cat_filter) && !empty($fields_args['ajax_filter_' . $cat_filter])) {
[268] Fix | Delete
$filter_args['ajax_filter_' . $cat_filter] = sanitize_text_field($fields_args['ajax_filter_' . $cat_filter]);
[269] Fix | Delete
}
[270] Fix | Delete
if (isset($fields_args['ajax_sort']) && $fields_args['ajax_sort'] === 'yes') {
[271] Fix | Delete
$filter_args['ajax_sort'] = 'yes';
[272] Fix | Delete
$filter_args['ajax_sort_order'] = $args['order'];
[273] Fix | Delete
$filter_args['ajax_sort_order_by'] = $args['orderby'];
[274] Fix | Delete
}
[275] Fix | Delete
}
[276] Fix | Delete
themify_masonry_filter($filter_args);
[277] Fix | Delete
unset($filter_args);
[278] Fix | Delete
$class[] = 'masonry';
[279] Fix | Delete
}
[280] Fix | Delete
$class = apply_filters('themify_loops_wrapper_class', $class, $fields_args['post_type_' . $mod_name], $fields_args['layout_' . $mod_name], 'builder', $fields_args, $mod_name);
[281] Fix | Delete
$class[] = 'tf_clear tf_clearfix';
[282] Fix | Delete
$container_props = apply_filters('themify_builder_blog_container_props', array(
[283] Fix | Delete
'class' => $class
[284] Fix | Delete
), $fields_args['post_type_' . $mod_name], $fields_args['layout_' . $mod_name], $fields_args, $mod_name);
[285] Fix | Delete
if ('ajax' === $fields_args['nav_type'] || true === $is_ajax_filter) {
[286] Fix | Delete
$container_props['class'][] = 'tb_ajax_pagination';
[287] Fix | Delete
$container_props['data-id'] = $element_id;
[288] Fix | Delete
}
[289] Fix | Delete
if (Themify_Builder::$frontedit_active === false) {
[290] Fix | Delete
$container_props['data-lazy'] = 1;
[291] Fix | Delete
}
[292] Fix | Delete
if (!empty($fields_args['masonry_align']) && 'yes' === $fields_args['masonry_align'] && in_array('masonry', $container_props['class'], true)) {
[293] Fix | Delete
$container_props['data-layout'] = 'fitRows';
[294] Fix | Delete
}
[295] Fix | Delete
$container_props['class'] = implode(' ', $container_props['class']);
[296] Fix | Delete
?>
[297] Fix | Delete
<div <?php echo themify_get_element_attributes($container_props); ?>>
[298] Fix | Delete
<?php
[299] Fix | Delete
$container_props=$class=null;
[300] Fix | Delete
if (!empty($posts)) {
[301] Fix | Delete
$isLoop = Themify_Builder::$is_loop;
[302] Fix | Delete
[303] Fix | Delete
// if the active theme is using Themify framework use theme template loop (includes/loop.php file)
[304] Fix | Delete
if (themify_is_themify_theme() && ($mod_name === 'post' || Themify_Builder_Model::is_loop_template_exist('loop-' . $mod_name . '.php', 'includes'))) {
[305] Fix | Delete
[306] Fix | Delete
// hooks action
[307] Fix | Delete
do_action_ref_array('themify_builder_override_loop_themify_vars', array(
[308] Fix | Delete
$themify,
[309] Fix | Delete
$mod_name,
[310] Fix | Delete
$fields_args
[311] Fix | Delete
));
[312] Fix | Delete
Themify_Builder::$is_loop = true;
[313] Fix | Delete
echo themify_get_shortcode_template($posts, 'includes/loop', $mod_name);
[314] Fix | Delete
} else {
[315] Fix | Delete
// use builder template
[316] Fix | Delete
global $post;
[317] Fix | Delete
if ( isset( $post ) ){
[318] Fix | Delete
$saved_post = clone $post;
[319] Fix | Delete
}
[320] Fix | Delete
$param_image = array(
[321] Fix | Delete
'w' => $fields_args['img_width_' . $mod_name],
[322] Fix | Delete
'h' => $fields_args['img_height_' . $mod_name]
[323] Fix | Delete
);
[324] Fix | Delete
if ($fields_args['image_size_' . $mod_name] !== '') {
[325] Fix | Delete
$param_image['image_size'] = $fields_args['image_size_' . $mod_name];
[326] Fix | Delete
}
[327] Fix | Delete
$cl = 'post tf_clearfix';
[328] Fix | Delete
if ($mod_name !== 'post') {
[329] Fix | Delete
$cl .= ' ' . $mod_name . '-post';
[330] Fix | Delete
}
[331] Fix | Delete
$is_comment_open = themify_builder_get('setting-comments_posts');
[332] Fix | Delete
Themify_Builder::$is_loop = true;
[333] Fix | Delete
foreach ($posts as $p):
[334] Fix | Delete
$post=$p;
[335] Fix | Delete
setup_postdata($p);
[336] Fix | Delete
?>
[337] Fix | Delete
[338] Fix | Delete
<?php themify_post_before(); // hook ?>
[339] Fix | Delete
[340] Fix | Delete
<article id="post-<?php the_ID(); ?>" <?php post_class($cl); ?>>
[341] Fix | Delete
[342] Fix | Delete
<?php themify_post_start(); // hook ?>
[343] Fix | Delete
[344] Fix | Delete
<?php
[345] Fix | Delete
if ($fields_args['hide_feat_img_' . $mod_name] !== 'yes') {
[346] Fix | Delete
[347] Fix | Delete
//check if there is a video url in the custom field
[348] Fix | Delete
if ($vurl = themify_builder_get('video_url', false, false)) {
[349] Fix | Delete
global $wp_embed;
[350] Fix | Delete
[351] Fix | Delete
themify_before_post_image(); // Hook
[352] Fix | Delete
[353] Fix | Delete
echo $wp_embed->run_shortcode('[embed]' . esc_url($vurl) . '[/embed]');
[354] Fix | Delete
[355] Fix | Delete
themify_after_post_image(); // Hook
[356] Fix | Delete
} elseif ($post_image = themify_get_image($param_image)) {
[357] Fix | Delete
[358] Fix | Delete
themify_before_post_image(); // Hook
[359] Fix | Delete
?>
[360] Fix | Delete
[361] Fix | Delete
<figure class="post-image">
[362] Fix | Delete
<?php if ($fields_args['unlink_feat_img_' . $mod_name] === 'yes'): ?>
[363] Fix | Delete
<?php echo $post_image; ?>
[364] Fix | Delete
<?php else: ?>
[365] Fix | Delete
<a <?php themify_permalink_attr( [ 'is_lightbox' => $posts_in_lightbox ] ); ?>><?php echo $post_image; ?></a>
[366] Fix | Delete
<?php endif; ?>
[367] Fix | Delete
</figure>
[368] Fix | Delete
[369] Fix | Delete
<?php
[370] Fix | Delete
themify_after_post_image(); // Hook
[371] Fix | Delete
}
[372] Fix | Delete
}
[373] Fix | Delete
?>
[374] Fix | Delete
[375] Fix | Delete
<div class="post-content">
[376] Fix | Delete
[377] Fix | Delete
<?php if ($fields_args['hide_post_date_' . $mod_name] !== 'yes'): ?>
[378] Fix | Delete
<time datetime="<?php the_time('o-m-d') ?>" class="post-date" pubdate><?php echo get_the_date(apply_filters('themify_loop_date', '')) ?></time>
[379] Fix | Delete
<?php endif; //post date ?>
[380] Fix | Delete
[381] Fix | Delete
<?php if ($fields_args['hide_post_title_' . $mod_name] !== 'yes'): ?>
[382] Fix | Delete
<?php themify_before_post_title(); // Hook ?>
[383] Fix | Delete
<<?php echo $fields_args['title_tag_' . $mod_name]; ?> class="post-title">
[384] Fix | Delete
<?php if ($fields_args['unlink_post_title_' . $mod_name] === 'yes'): ?>
[385] Fix | Delete
<?php the_title(); ?>
[386] Fix | Delete
<?php else: ?>
[387] Fix | Delete
<a <?php themify_permalink_attr( [ 'is_lightbox' => $posts_in_lightbox ] ); ?>><?php the_title(); ?></a>
[388] Fix | Delete
<?php endif; //unlink post title ?>
[389] Fix | Delete
</<?php echo $fields_args['title_tag_' . $mod_name]; ?>>
[390] Fix | Delete
<?php themify_after_post_title(); // Hook ?>
[391] Fix | Delete
<?php endif; //post title ?>
[392] Fix | Delete
[393] Fix | Delete
<?php if ($fields_args['hide_post_meta_' . $mod_name] !== 'yes'): ?>
[394] Fix | Delete
<p class="post-meta">
[395] Fix | Delete
<span class="post-author"><?php the_author_posts_link() ?></span>
[396] Fix | Delete
<span class="post-category">
[397] Fix | Delete
<?php
[398] Fix | Delete
if ($mod_name === 'post') :
[399] Fix | Delete
echo get_the_category_list(', ', '', $p->ID);
[400] Fix | Delete
else :
[401] Fix | Delete
$terms = wp_get_post_terms($p->ID, $mod_name . '-category', array('fields' => 'names'));
[402] Fix | Delete
if (!is_wp_error($terms) && !empty($terms)) {
[403] Fix | Delete
echo implode(', ', $terms);
[404] Fix | Delete
}
[405] Fix | Delete
endif;
[406] Fix | Delete
?>
[407] Fix | Delete
</span>
[408] Fix | Delete
<?php the_tags(' <span class="post-tag">', ', ', '</span>'); ?>
[409] Fix | Delete
<?php if (!$is_comment_open && comments_open()) : ?>
[410] Fix | Delete
<span class="post-comment"><?php comments_popup_link(__('0 Comments', 'themify'), __('1 Comment', 'themify'), __('% Comments', 'themify')); ?></span>
[411] Fix | Delete
<?php endif; //post comment ?>
[412] Fix | Delete
</p>
[413] Fix | Delete
<?php endif; //post meta ?>
[414] Fix | Delete
[415] Fix | Delete
<?php
[416] Fix | Delete
if ($fields_args['display_' . $mod_name] !== 'none') {
[417] Fix | Delete
// fix the issue more link doesn't output
[418] Fix | Delete
global $more;
[419] Fix | Delete
$more = 0;
[420] Fix | Delete
themify_before_post_content();
[421] Fix | Delete
if ($fields_args['display_' . $mod_name] === 'excerpt') {
[422] Fix | Delete
the_excerpt();
[423] Fix | Delete
} else {
[424] Fix | Delete
$moreText = themify_builder_get('setting-default_more_text');
[425] Fix | Delete
if (!$moreText) {
[426] Fix | Delete
$moreText = __('More &rarr;', 'themify');
[427] Fix | Delete
}
[428] Fix | Delete
the_content($moreText);
[429] Fix | Delete
}
[430] Fix | Delete
themify_after_post_content();
[431] Fix | Delete
}
[432] Fix | Delete
?>
[433] Fix | Delete
<?php if ($mod_name === 'testimonial'): ?>
[434] Fix | Delete
<p class="testimonial-author">
[435] Fix | Delete
<?php
[436] Fix | Delete
echo themify_builder_testimonial_author_name($p, 'yes');
[437] Fix | Delete
?>
[438] Fix | Delete
</p>
[439] Fix | Delete
<?php endif; ?>
[440] Fix | Delete
[441] Fix | Delete
</div>
[442] Fix | Delete
<!-- /.post-content -->
[443] Fix | Delete
<?php themify_post_end(); // hook ?>
[444] Fix | Delete
[445] Fix | Delete
</article>
[446] Fix | Delete
<?php themify_post_after(); // hook ?>
[447] Fix | Delete
[448] Fix | Delete
<?php
[449] Fix | Delete
endforeach;
[450] Fix | Delete
[451] Fix | Delete
if ( isset( $saved_post )) {
[452] Fix | Delete
$post = $saved_post;
[453] Fix | Delete
setup_postdata( $saved_post );
[454] Fix | Delete
unset($saved_post);
[455] Fix | Delete
}
[456] Fix | Delete
} // end $is_theme_template
[457] Fix | Delete
Themify_Builder::$is_loop = $isLoop;
[458] Fix | Delete
if (isset($themify_save)) {
[459] Fix | Delete
// revert to original $themify state
[460] Fix | Delete
$themify = clone $themify_save;
[461] Fix | Delete
unset($themify_save);
[462] Fix | Delete
}
[463] Fix | Delete
if ($fields_args['display_' . $mod_name] === 'excerpt' && !empty($fields_args['excerpt_length_' . $mod_name])) {
[464] Fix | Delete
remove_filter('the_excerpt', 'themify_custom_except', 999);
[465] Fix | Delete
}
[466] Fix | Delete
} else {
[467] Fix | Delete
if (isset($fields_args['no_posts'], $fields_args['no_posts_msg'])) {
[468] Fix | Delete
echo '<div class="tb_no_posts">' , $fields_args['no_posts_msg'] , '</div>';
[469] Fix | Delete
} elseif (current_user_can('publish_posts') && true !== $is_ajax_filter) {
[470] Fix | Delete
printf(__('No posts found matching the query. <a href="%s" target="_blank">Click here</a> to add posts.', 'themify'), $args['post_type'] !== 'post' ? admin_url('post-new.php?post_type=' . $args['post_type']) : admin_url('post-new.php'));
[471] Fix | Delete
}
[472] Fix | Delete
}
[473] Fix | Delete
?>
[474] Fix | Delete
</div><!-- .builder-posts-wrap -->
[475] Fix | Delete
<?php if ('yes' !== $fields_args['hide_page_nav_' . $mod_name]): ?>
[476] Fix | Delete
<?php if ('ajax' === $fields_args['nav_type']): ?>
[477] Fix | Delete
<?php
[478] Fix | Delete
if ($the_query->max_num_pages > $args['paged']) {
[479] Fix | Delete
if (Themify_Builder::$frontedit_active === false) {
[480] Fix | Delete
Themify_Enqueue_Assets::loadinfiniteCss();
[481] Fix | Delete
}
[482] Fix | Delete
$url = is_single() ? add_query_arg(array('tf-page' => ($args['paged'] + 1)), get_permalink(get_queried_object_id())) : next_posts($the_query->max_num_pages, false);
[483] Fix | Delete
echo '<p class="tf_load_more tf_textc tf_clear"><a data-id="', $element_id, '" href="', $url, '" data-page="', esc_attr($args['paged']), '" class="load-more-button">', __('Load More', 'themify'), '</a></p>';
[484] Fix | Delete
}
[485] Fix | Delete
?>
[486] Fix | Delete
<?php else: ?>
[487] Fix | Delete
<?php echo self::get_pagination('', '', $the_query, $offset) ?>
[488] Fix | Delete
<?php endif; ?>
[489] Fix | Delete
<?php endif; ?>
[490] Fix | Delete
<?php
[491] Fix | Delete
do_action('themify_builder_after_template_content_render');
[492] Fix | Delete
?>
[493] Fix | Delete
</div>
[494] Fix | Delete
<!-- /module post -->
[495] Fix | Delete
<?php
[496] Fix | Delete
Themify_Builder_Model::hook_content_end($fields_args);
[497] Fix | Delete
$fields_args = $the_query = $args=null;
[498] Fix | Delete
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function