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/accelera.../componen.../loop
File: loop.php
<?php
[0] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[1] Fix | Delete
exit;
[2] Fix | Delete
}
[3] Fix | Delete
function amp_archive_title(){
[4] Fix | Delete
global $redux_builder_amp;
[5] Fix | Delete
if( is_author() ){
[6] Fix | Delete
$author_name = esc_attr(get_query_var('author_name'));
[7] Fix | Delete
$author = esc_attr(get_query_var('author'));
[8] Fix | Delete
$curauth = (get_query_var('author_name')) ? get_user_by('slug', $author_name) : get_userdata($author);
[9] Fix | Delete
//added code for guest author compatibility for plugin coauthors
[10] Fix | Delete
if(!$curauth && function_exists('get_the_coauthor_meta') )
[11] Fix | Delete
{
[12] Fix | Delete
$thumb_url=ampforwp_get_coauthor_meta('avatar_url');
[13] Fix | Delete
if($thumb_url){
[14] Fix | Delete
$display_name=ampforwp_get_coauthor_meta('display_name');
[15] Fix | Delete
?>
[16] Fix | Delete
<div class="amp-wp-content author-img">
[17] Fix | Delete
<amp-img src="<?php echo esc_url($thumb_url); ?>" width="90" height="90" layout="responsive" alt="<?php echo esc_html($display_name); ?>"></amp-img>
[18] Fix | Delete
</div>
[19] Fix | Delete
<?php }
[20] Fix | Delete
[21] Fix | Delete
}
[22] Fix | Delete
else{
[23] Fix | Delete
if( true == ampforwp_gravatar_checker($curauth->user_email) ){
[24] Fix | Delete
$curauth_url = get_avatar_url( $curauth->user_email, array('size'=>180) );
[25] Fix | Delete
if($curauth_url){ ?>
[26] Fix | Delete
<div class="amp-wp-content author-img">
[27] Fix | Delete
<amp-img src="<?php echo esc_url($curauth_url); ?>" width="90" height="90" layout="responsive" alt="<?php echo esc_html(get_the_author()); ?>"></amp-img>
[28] Fix | Delete
</div>
[29] Fix | Delete
<?php }
[30] Fix | Delete
}
[31] Fix | Delete
}
[32] Fix | Delete
}
[33] Fix | Delete
if ( is_archive() ) {
[34] Fix | Delete
$description = $sanitizer = $arch_desc = '';
[35] Fix | Delete
if(ampforwp_default_logo()){
[36] Fix | Delete
the_archive_title( '<h1 class="amp-archive-title">', '</h1>' );
[37] Fix | Delete
}else{
[38] Fix | Delete
the_archive_title( '<h2 class="amp-archive-title">', '</h2>' );
[39] Fix | Delete
}
[40] Fix | Delete
if(function_exists('ampforwp_category_image_compatibility')){
[41] Fix | Delete
ampforwp_category_image_compatibility('echo','amp-archive-image');
[42] Fix | Delete
}
[43] Fix | Delete
$description = get_the_archive_description();
[44] Fix | Delete
$sanitizer = new AMPFORWP_Content( $description, array(),
[45] Fix | Delete
apply_filters( 'ampforwp_content_sanitizers',
[46] Fix | Delete
array(
[47] Fix | Delete
'AMP_Style_Sanitizer' => array(),
[48] Fix | Delete
'AMP_Blacklist_Sanitizer' => array(),
[49] Fix | Delete
'AMP_Img_Sanitizer' => array(),
[50] Fix | Delete
'AMP_Video_Sanitizer' => array(),
[51] Fix | Delete
'AMP_Audio_Sanitizer' => array(),
[52] Fix | Delete
'AMP_Iframe_Sanitizer' => array(
[53] Fix | Delete
'add_placeholder' => true,
[54] Fix | Delete
)
[55] Fix | Delete
) ) );
[56] Fix | Delete
$arch_desc = $sanitizer->get_amp_content();
[57] Fix | Delete
if( $arch_desc ) {
[58] Fix | Delete
if ( get_query_var( 'paged' ) ) {
[59] Fix | Delete
$paged = get_query_var('paged');
[60] Fix | Delete
} elseif ( get_query_var( 'page' ) ) {
[61] Fix | Delete
$paged = get_query_var('page');
[62] Fix | Delete
} else {
[63] Fix | Delete
$paged = 1;
[64] Fix | Delete
}
[65] Fix | Delete
if($paged <= '1' && ampforwp_get_setting('ampforwp-cat-description')) {?>
[66] Fix | Delete
<div class="amp-archive-desc">
[67] Fix | Delete
<?php echo do_shortcode($arch_desc);// amphtml content, no kses ?>
[68] Fix | Delete
</div> <?php
[69] Fix | Delete
}
[70] Fix | Delete
}
[71] Fix | Delete
}
[72] Fix | Delete
if( is_category() && 1 == $redux_builder_amp['ampforwp-sub-categories-support'] ){
[73] Fix | Delete
$parent_cat_id = '';
[74] Fix | Delete
$cat_childs = array();
[75] Fix | Delete
$parent_cat_id = get_queried_object_id();
[76] Fix | Delete
$cat_childs = get_terms( array(
[77] Fix | Delete
'taxonomy' => get_queried_object()->taxonomy,
[78] Fix | Delete
'parent' => $parent_cat_id )
[79] Fix | Delete
);
[80] Fix | Delete
if( !empty( $cat_childs ) ){
[81] Fix | Delete
echo "<div class='amp-sub-archives'><ul>";
[82] Fix | Delete
foreach ($cat_childs as $cat_child ) {
[83] Fix | Delete
$cat_child_url = get_term_link( $cat_child );
[84] Fix | Delete
if(true == ampforwp_get_setting('convert-internal-nonamplinks-to-amp')){
[85] Fix | Delete
$cat_child_url = ampforwp_url_controller($cat_child_url);
[86] Fix | Delete
}
[87] Fix | Delete
echo '<li><a href="' . esc_url($cat_child_url) . '">' . esc_attr($cat_child->name) . '</a></li>';
[88] Fix | Delete
}
[89] Fix | Delete
echo "</ul></div>";
[90] Fix | Delete
}
[91] Fix | Delete
}
[92] Fix | Delete
if(is_search()){
[93] Fix | Delete
$label = 'You searched for:';
[94] Fix | Delete
if(function_exists('ampforwp_translation')){
[95] Fix | Delete
$label = ampforwp_translation( $redux_builder_amp['amp-translator-search-text'], 'You searched for:');
[96] Fix | Delete
}
[97] Fix | Delete
[98] Fix | Delete
if(ampforwp_default_logo()){
[99] Fix | Delete
echo '<h1 class="amp-loop-label">'.$label . ' ' . get_search_query().'</h1>';
[100] Fix | Delete
}else{
[101] Fix | Delete
echo '<h2 class="amp-loop-label">'.$label . ' ' . get_search_query().'</h2>';
[102] Fix | Delete
}
[103] Fix | Delete
}
[104] Fix | Delete
}
[105] Fix | Delete
[106] Fix | Delete
$amp_q = '';
[107] Fix | Delete
$count = 1;
[108] Fix | Delete
function call_loops_standard($data=array()){
[109] Fix | Delete
global $amp_q;
[110] Fix | Delete
$post_type = get_post_type();
[111] Fix | Delete
if (get_query_var( 'paged' ) ) {
[112] Fix | Delete
$paged = get_query_var('paged');
[113] Fix | Delete
} elseif ( get_query_var( 'page' ) ) {
[114] Fix | Delete
$paged = get_query_var('page');
[115] Fix | Delete
} else {
[116] Fix | Delete
$paged = 1;
[117] Fix | Delete
}
[118] Fix | Delete
[119] Fix | Delete
$qobj_taxonomy = $qobj_term_id = "";
[120] Fix | Delete
[121] Fix | Delete
if ( is_archive() ) {
[122] Fix | Delete
$exclude_ids = ampforwp_exclude_posts();
[123] Fix | Delete
$qobj = get_queried_object();
[124] Fix | Delete
if( !is_date() ){
[125] Fix | Delete
$args = array(
[126] Fix | Delete
'no_found_rows' => true,
[127] Fix | Delete
'post_type' => $post_type,
[128] Fix | Delete
'orderby' => 'date',
[129] Fix | Delete
'ignore_sticky_posts' => 1,
[130] Fix | Delete
'paged' => esc_attr($paged),
[131] Fix | Delete
'post__not_in' => $exclude_ids,
[132] Fix | Delete
'has_password' => false ,
[133] Fix | Delete
'post_status'=> 'publish'
[134] Fix | Delete
);
[135] Fix | Delete
if ( is_category() || ( isset($qobj->taxonomy) && taxonomy_exists($qobj->taxonomy)) ) {
[136] Fix | Delete
$args['tax_query'] = array(
[137] Fix | Delete
array(
[138] Fix | Delete
'taxonomy' => $qobj->taxonomy,
[139] Fix | Delete
'field' => 'id',
[140] Fix | Delete
'terms' => $qobj->term_id,
[141] Fix | Delete
),
[142] Fix | Delete
);
[143] Fix | Delete
}
[144] Fix | Delete
}
[145] Fix | Delete
if(is_date()){
[146] Fix | Delete
$year = get_query_var('year');
[147] Fix | Delete
$monthnum = get_query_var('monthnum');
[148] Fix | Delete
$week = get_query_var('week');
[149] Fix | Delete
$day = get_query_var('day');
[150] Fix | Delete
[151] Fix | Delete
$args = array(
[152] Fix | Delete
'date_query' => array(
[153] Fix | Delete
array('year' => esc_attr($year))
[154] Fix | Delete
),
[155] Fix | Delete
'paged' => esc_attr($paged),
[156] Fix | Delete
'post__not_in' => $exclude_ids,
[157] Fix | Delete
'has_password' => false ,
[158] Fix | Delete
'post_status' => 'publish',
[159] Fix | Delete
'no_found_rows' => true
[160] Fix | Delete
);
[161] Fix | Delete
if ( $monthnum ) {
[162] Fix | Delete
$args['date_query'][0]['month'] = esc_attr($monthnum);
[163] Fix | Delete
}
[164] Fix | Delete
if ( $week ) {
[165] Fix | Delete
$args['date_query'][0]['week'] = esc_attr($week);
[166] Fix | Delete
}
[167] Fix | Delete
if ( $day ) {
[168] Fix | Delete
$args['date_query'][0]['day'] = esc_attr($day);
[169] Fix | Delete
}
[170] Fix | Delete
}
[171] Fix | Delete
}
[172] Fix | Delete
if ( is_home() ) {
[173] Fix | Delete
$exclude_ids = ampforwp_exclude_posts();
[174] Fix | Delete
$args = array(
[175] Fix | Delete
'no_found_rows' => true,
[176] Fix | Delete
'post_type' => 'post',
[177] Fix | Delete
'orderby' => 'date',
[178] Fix | Delete
'paged' => esc_attr($paged),
[179] Fix | Delete
'post__not_in' => $exclude_ids,
[180] Fix | Delete
'has_password' => false ,
[181] Fix | Delete
'post_status' => 'publish'
[182] Fix | Delete
);
[183] Fix | Delete
}
[184] Fix | Delete
[185] Fix | Delete
if ( is_search() ) {
[186] Fix | Delete
$exclude_ids = ampforwp_exclude_posts();
[187] Fix | Delete
$args = array(
[188] Fix | Delete
's' => get_search_query() ,
[189] Fix | Delete
'ignore_sticky_posts' => 1,
[190] Fix | Delete
'paged' => esc_attr($paged),
[191] Fix | Delete
'post__not_in' => $exclude_ids,
[192] Fix | Delete
'has_password' => false ,
[193] Fix | Delete
'post_status' => 'publish',
[194] Fix | Delete
'no_found_rows' => true
[195] Fix | Delete
);
[196] Fix | Delete
}
[197] Fix | Delete
if(is_author()){
[198] Fix | Delete
$exclude_ids = ampforwp_exclude_posts();
[199] Fix | Delete
$author_name = esc_attr(get_query_var( 'author_name' ));
[200] Fix | Delete
$args = array(
[201] Fix | Delete
'author_name' => $author_name,
[202] Fix | Delete
'post_type' => 'post',
[203] Fix | Delete
'orderby' => 'date',
[204] Fix | Delete
'ignore_sticky_posts' => 1,
[205] Fix | Delete
'paged' => esc_attr($paged),
[206] Fix | Delete
'post__not_in' => $exclude_ids,
[207] Fix | Delete
'has_password' => false ,
[208] Fix | Delete
'post_status' => 'publish',
[209] Fix | Delete
'no_found_rows' => true
[210] Fix | Delete
);
[211] Fix | Delete
}
[212] Fix | Delete
if( is_single() ) {
[213] Fix | Delete
global $post;
[214] Fix | Delete
$exclude_ids = ampforwp_exclude_posts();
[215] Fix | Delete
$exclude_ids[] = $post->ID;
[216] Fix | Delete
$args = array(
[217] Fix | Delete
'no_found_rows' => true,
[218] Fix | Delete
'post_type' => get_post_type($post),
[219] Fix | Delete
'orderby' => 'date',
[220] Fix | Delete
'ignore_sticky_posts' => 1,
[221] Fix | Delete
'paged' => esc_attr($paged),
[222] Fix | Delete
'post__not_in' => $exclude_ids,
[223] Fix | Delete
'has_password' => false ,
[224] Fix | Delete
'post_status' => 'publish'
[225] Fix | Delete
);
[226] Fix | Delete
}
[227] Fix | Delete
if( isset( $data['post_to_show'] ) && $data['post_to_show']>0 ){
[228] Fix | Delete
$args['posts_per_page'] = $data['post_to_show'];
[229] Fix | Delete
}
[230] Fix | Delete
if( isset( $data['offset'] ) && $data['offset']>0 ){
[231] Fix | Delete
$args['offset'] = $data['offset'];
[232] Fix | Delete
}
[233] Fix | Delete
if( isset( $data['posts_per_page'] ) && $data['posts_per_page']>0 ){
[234] Fix | Delete
$args['posts_per_page'] = $data['posts_per_page'];
[235] Fix | Delete
}
[236] Fix | Delete
$filtered_args = apply_filters('ampforwp_query_args', $args);
[237] Fix | Delete
$amp_q = new WP_Query( $filtered_args );
[238] Fix | Delete
[239] Fix | Delete
// If Relevanssi is available and this is a search, pass the query to Relevanssi
[240] Fix | Delete
// for improved search results. 2018-07-03 Mikko Saari (mikko@mikkosaari.fi)
[241] Fix | Delete
if ( is_search() && function_exists( 'relevanssi_do_query' ) ) {
[242] Fix | Delete
relevanssi_do_query( $amp_q );
[243] Fix | Delete
}
[244] Fix | Delete
}
[245] Fix | Delete
//call_loops_standered();
[246] Fix | Delete
/****
[247] Fix | Delete
* AMP Loop Functions
[248] Fix | Delete
*/
[249] Fix | Delete
//add_action("init", 'call_loops_standered');
[250] Fix | Delete
[251] Fix | Delete
function amp_loop($selection,$data=array()){
[252] Fix | Delete
global $amp_q;
[253] Fix | Delete
if(empty($amp_q) || is_null($amp_q)){
[254] Fix | Delete
call_loops_standard($data);
[255] Fix | Delete
echo "<div class='loop-wrapper'>";
[256] Fix | Delete
}
[257] Fix | Delete
if ( false == $amp_q->have_posts() ) {
[258] Fix | Delete
return;
[259] Fix | Delete
}
[260] Fix | Delete
if ( !isset($ampLoopData['no_data']) ) :
[261] Fix | Delete
switch($selection){
[262] Fix | Delete
case 'start':
[263] Fix | Delete
return amp_start_loop();
[264] Fix | Delete
break;
[265] Fix | Delete
case 'end':
[266] Fix | Delete
return amp_end_loop();
[267] Fix | Delete
break;
[268] Fix | Delete
}
[269] Fix | Delete
else : // If no posts exist.
[270] Fix | Delete
return false;
[271] Fix | Delete
endif; // End loop.
[272] Fix | Delete
}
[273] Fix | Delete
[274] Fix | Delete
function amp_start_loop(){
[275] Fix | Delete
global $amp_q, $count;
[276] Fix | Delete
$post_status = $amp_q->have_posts();
[277] Fix | Delete
$amp_q->the_post();
[278] Fix | Delete
do_action('ampforwp_between_loop',$count);
[279] Fix | Delete
$count++;
[280] Fix | Delete
return $post_status;
[281] Fix | Delete
}
[282] Fix | Delete
function amp_end_loop(){
[283] Fix | Delete
global $amp_q;
[284] Fix | Delete
wp_reset_postdata();
[285] Fix | Delete
echo "</div>";
[286] Fix | Delete
}
[287] Fix | Delete
[288] Fix | Delete
function amp_reset_loop(){
[289] Fix | Delete
global $amp_q;
[290] Fix | Delete
$amp_q = '';
[291] Fix | Delete
return "";
[292] Fix | Delete
}
[293] Fix | Delete
[294] Fix | Delete
function amp_pagination($args =array()) {
[295] Fix | Delete
global $amp_q, $wp_query, $redux_builder_amp;
[296] Fix | Delete
[297] Fix | Delete
if (get_query_var( 'paged' ) ) {
[298] Fix | Delete
$paged = get_query_var('paged');
[299] Fix | Delete
} elseif ( get_query_var( 'page' ) ) {
[300] Fix | Delete
$paged = get_query_var('page');
[301] Fix | Delete
} else {
[302] Fix | Delete
$paged = 1;
[303] Fix | Delete
}
[304] Fix | Delete
$paged = esc_attr($paged);
[305] Fix | Delete
$pre_link = '';
[306] Fix | Delete
if(!isset($args['previous_text']) || $args['previous_text']==''){
[307] Fix | Delete
$args['previous_text'] = 'Show previous Posts';
[308] Fix | Delete
}
[309] Fix | Delete
if(!isset($args['next_text']) || $args['next_text']==''){
[310] Fix | Delete
$args['next_text'] = 'Show more Posts';
[311] Fix | Delete
}?>
[312] Fix | Delete
[313] Fix | Delete
<div class="loop-pagination"><?php
[314] Fix | Delete
if (function_exists('wp_pagenavi')) {
[315] Fix | Delete
wp_pagenavi();
[316] Fix | Delete
}else{
[317] Fix | Delete
if ( get_next_posts_link( $args['next_text'], $amp_q->max_num_pages ) ) {
[318] Fix | Delete
$next_link = '<div class="right">'. apply_filters('ampforwp_next_posts_link',get_next_posts_link( ampforwp_translation($redux_builder_amp['amp-translator-show-more-posts-text'] , $args['next_text']), $amp_q->max_num_pages ), $paged) .'</div>';
[319] Fix | Delete
echo $next_link; // escaped above
[320] Fix | Delete
}
[321] Fix | Delete
if ( get_previous_posts_link() ) {
[322] Fix | Delete
$pre_link = '<div class="left">'.apply_filters('ampforwp_previous_posts_link',get_previous_posts_link( ampforwp_translation($redux_builder_amp['amp-translator-show-previous-posts-text'], $args['previous_text'] ) ), $paged ) .'</div>';
[323] Fix | Delete
echo $pre_link; // escaped above
[324] Fix | Delete
} ?>
[325] Fix | Delete
<div class="clearfix"></div>
[326] Fix | Delete
</div><?php }
[327] Fix | Delete
[328] Fix | Delete
}
[329] Fix | Delete
[330] Fix | Delete
/***
[331] Fix | Delete
* Get Title of post
[332] Fix | Delete
* Arguments: $data = array('class' => 'new-class test-class', 'data-attr-test'=> 'data-val');
[333] Fix | Delete
* Usage : amp_loop_title($data);
[334] Fix | Delete
*/
[335] Fix | Delete
function amp_loop_title($data=array()){
[336] Fix | Delete
$data = array_filter($data);
[337] Fix | Delete
$tag = 'h2';
[338] Fix | Delete
if ( is_archive() || is_search() ) {
[339] Fix | Delete
if(ampforwp_default_logo()){
[340] Fix | Delete
$tag = 'h2';
[341] Fix | Delete
}else{
[342] Fix | Delete
$tag = 'h3';
[343] Fix | Delete
}
[344] Fix | Delete
}
[345] Fix | Delete
if(isset($data['tag']) && $data['tag']!=""){
[346] Fix | Delete
$tag = $data['tag'];
[347] Fix | Delete
}
[348] Fix | Delete
// if $data is in key & value pair
[349] Fix | Delete
$data_val = $data_attr = $attr_val = '';
[350] Fix | Delete
foreach ($data as $key => $value) {
[351] Fix | Delete
$data_attr .= $key;
[352] Fix | Delete
if( $key != 'attributes' && $key != 'tag' ){
[353] Fix | Delete
if($key == 'class'){
[354] Fix | Delete
$value .= ' '.esc_html('loop-title');
[355] Fix | Delete
}
[356] Fix | Delete
$data_val .= "".esc_attr($key)."='".esc_html($value)."' ";
[357] Fix | Delete
}
[358] Fix | Delete
}
[359] Fix | Delete
// if $data key is attributes & tag
[360] Fix | Delete
if(!isset($data['attributes'])){
[361] Fix | Delete
$data_attr = '';
[362] Fix | Delete
}
[363] Fix | Delete
if( (isset($data_attr) && false !== strpos($data_attr,'attributes')) || empty($data_attr) ){
[364] Fix | Delete
$attributes = 'class="loop-title"';
[365] Fix | Delete
if(isset($data['attributes']) && $data['attributes']!=""){
[366] Fix | Delete
$attributes = $data['attributes'];
[367] Fix | Delete
}
[368] Fix | Delete
$attributes = explode('"', $attributes);
[369] Fix | Delete
$attributes = str_replace('=','', $attributes);
[370] Fix | Delete
for($i=0; $i < count($attributes); $i=$i+2) {
[371] Fix | Delete
if( !empty($attributes[$i]) && !empty($attributes[$i+1]) ){
[372] Fix | Delete
if( $attributes[$i] == 'class' && $attributes[$i+1] != 'loop-title'){
[373] Fix | Delete
$attributes[$i+1] .= ' '.esc_html('loop-title');
[374] Fix | Delete
}
[375] Fix | Delete
$attr_val .= "".esc_attr($attributes[$i])."='".esc_html($attributes[$i+1])."'";
[376] Fix | Delete
}
[377] Fix | Delete
}
[378] Fix | Delete
}
[379] Fix | Delete
echo '<'.esc_attr($tag).' '.$attr_val.' '.$data_val.'>';
[380] Fix | Delete
if(!isset($data['link']) ){
[381] Fix | Delete
echo '<a href="'. esc_url(amp_loop_permalink(true)) .'">';
[382] Fix | Delete
}
[383] Fix | Delete
echo the_title('','',false);
[384] Fix | Delete
[385] Fix | Delete
if(!isset($data['link']) ){
[386] Fix | Delete
echo '</a>';
[387] Fix | Delete
}
[388] Fix | Delete
echo '</'.esc_attr($tag).'>';
[389] Fix | Delete
}
[390] Fix | Delete
[391] Fix | Delete
function amp_loop_date($args=array()){
[392] Fix | Delete
global $redux_builder_amp;
[393] Fix | Delete
if ( 2 == $redux_builder_amp['ampforwp-post-date-format'] ) {
[394] Fix | Delete
$args['format'] = 'traditional';
[395] Fix | Delete
}
[396] Fix | Delete
if(isset($args['format']) && $args['format']=='traditional'){
[397] Fix | Delete
$post_date = get_the_date();
[398] Fix | Delete
}else{
[399] Fix | Delete
$post_date = human_time_diff(
[400] Fix | Delete
get_the_time('U', get_the_ID() ),
[401] Fix | Delete
current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],
[402] Fix | Delete
'ago');
[403] Fix | Delete
}
[404] Fix | Delete
$post_date = apply_filters('ampforwp_modify_post_date',$post_date);
[405] Fix | Delete
echo '<div class="loop-date">'.esc_html($post_date).'</div>';
[406] Fix | Delete
}
[407] Fix | Delete
[408] Fix | Delete
function amp_loop_excerpt($excerpt_length = 15,$tag = 'p', $class = ''){
[409] Fix | Delete
//excerpt
[410] Fix | Delete
global $post,$redux_builder_amp;
[411] Fix | Delete
$excerpt_length = (int) $excerpt_length;
[412] Fix | Delete
[413] Fix | Delete
if ( empty( $class )) {
[414] Fix | Delete
$class = 'loop-excerpt';
[415] Fix | Delete
}
[416] Fix | Delete
[417] Fix | Delete
if( has_excerpt() ) {
[418] Fix | Delete
$content = get_the_excerpt();
[419] Fix | Delete
} else {
[420] Fix | Delete
$content = get_the_content();
[421] Fix | Delete
}
[422] Fix | Delete
$content = strip_shortcodes( $content );
[423] Fix | Delete
[424] Fix | Delete
if ( ampforwp_is_home() ){
[425] Fix | Delete
$content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
[426] Fix | Delete
} else {
[427] Fix | Delete
$content = apply_filters('ampforwp_modify_archive_content', $content, $excerpt_length );
[428] Fix | Delete
}
[429] Fix | Delete
[430] Fix | Delete
if( ampforwp_get_setting('ampforwp-homepage-loop-readmore-link') == 1 ) {
[431] Fix | Delete
echo ('<'.esc_attr($tag).' class="'.esc_attr($class).'">'. wp_trim_words( $content, $excerpt_length ) .' '.'<a href="'. ampforwp_url_controller(get_permalink($post->ID)) . '">'. ampforwp_translation($redux_builder_amp['amp-translator-read-more'],'Read More') . '</a></'.esc_attr($tag).'>');
[432] Fix | Delete
} else {
[433] Fix | Delete
echo ('<'.esc_attr($tag).' class="'.esc_attr($class).'">'. wp_trim_words( $content, $excerpt_length ) .'</'.esc_attr($tag).'>');
[434] Fix | Delete
}
[435] Fix | Delete
[436] Fix | Delete
}
[437] Fix | Delete
[438] Fix | Delete
function amp_loop_all_content($tag = 'p'){
[439] Fix | Delete
$fullContent = strip_shortcodes( get_the_content() );
[440] Fix | Delete
echo ('<'.$tag.'>'. $fullContent .'</'.$tag.'>');
[441] Fix | Delete
}
[442] Fix | Delete
[443] Fix | Delete
function amp_loop_permalink($return = ''){
[444] Fix | Delete
if (is_single() && ampforwp_get_setting('ampforwp-single-related-posts-link')) {
[445] Fix | Delete
$url = get_permalink();
[446] Fix | Delete
}else{
[447] Fix | Delete
$url = ampforwp_url_controller( get_permalink() ) ;
[448] Fix | Delete
}
[449] Fix | Delete
$url = apply_filters('ampforwp_loop_permalink_update',$url);
[450] Fix | Delete
return $url;
[451] Fix | Delete
}
[452] Fix | Delete
[453] Fix | Delete
if (! function_exists('amp_loop_get_permalink')){
[454] Fix | Delete
function amp_loop_get_permalink(){
[455] Fix | Delete
return amp_loop_permalink();
[456] Fix | Delete
}
[457] Fix | Delete
}
[458] Fix | Delete
if (! function_exists('amp_loop_the_permalink')){
[459] Fix | Delete
function amp_loop_the_permalink(){
[460] Fix | Delete
echo amp_loop_get_permalink();
[461] Fix | Delete
}
[462] Fix | Delete
}
[463] Fix | Delete
function amp_loop_image( $data=array() ) {
[464] Fix | Delete
global $ampLoopData, $counterOffset, $redux_builder_amp;
[465] Fix | Delete
if (ampforwp_has_post_thumbnail() ) {
[466] Fix | Delete
[467] Fix | Delete
$tag = 'div';
[468] Fix | Delete
$tag_class = '';
[469] Fix | Delete
$layout_responsive = '';
[470] Fix | Delete
$imageClass = '';
[471] Fix | Delete
$imageSize = 'thumbnail';
[472] Fix | Delete
[473] Fix | Delete
if ( isset($data['tag']) && $data['tag'] != "" ) {
[474] Fix | Delete
$tag = $data['tag'];
[475] Fix | Delete
}
[476] Fix | Delete
[477] Fix | Delete
if ( isset($data['responsive']) && ( $data['responsive'] == "responsive" || $data['responsive'] == 'true' ) ) {
[478] Fix | Delete
$layout_responsive = 'layout=responsive';
[479] Fix | Delete
}elseif (isset($data['responsive']) && $data['responsive'] == "fill" ) {
[480] Fix | Delete
$layout_responsive = 'layout=fill';
[481] Fix | Delete
}
[482] Fix | Delete
[483] Fix | Delete
if ( isset($data['tag_class']) && $data['tag_class'] != "" ) {
[484] Fix | Delete
$tag_class = $data['tag_class'];
[485] Fix | Delete
}
[486] Fix | Delete
if ( isset($data['image_class']) && $data['image_class'] != "" ) {
[487] Fix | Delete
$imageClass = $data['image_class'];
[488] Fix | Delete
}
[489] Fix | Delete
if ( isset($data['image_size']) && $data['image_size'] != "" ) {
[490] Fix | Delete
$imageSize = $data['image_size'];
[491] Fix | Delete
}
[492] Fix | Delete
$thumb_url = ampforwp_get_post_thumbnail('url', $imageSize);
[493] Fix | Delete
$thumb_width = ampforwp_get_post_thumbnail('width', $imageSize);
[494] Fix | Delete
$thumb_height = ampforwp_get_post_thumbnail('height', $imageSize);
[495] Fix | Delete
[496] Fix | Delete
if ( isset($data['image_crop']) && $data['image_crop'] != "" ) {
[497] Fix | Delete
$width = $data['image_crop_width'];
[498] Fix | Delete
if ( empty($width) ) {
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function