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.../themes/herald/core
File: template-functions.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* Wrapper function for __()
[3] Fix | Delete
*
[4] Fix | Delete
* It checks if specific text is translated via options panel
[5] Fix | Delete
* If option is set, it returns translated text from theme options
[6] Fix | Delete
* If option is not set, it returns default translation string (from language file)
[7] Fix | Delete
*
[8] Fix | Delete
* @param string $string_key Key name (id) of translation option
[9] Fix | Delete
* @return string Returns translated string
[10] Fix | Delete
* @since 1.0
[11] Fix | Delete
*/
[12] Fix | Delete
[13] Fix | Delete
if ( !function_exists( '__herald' ) ):
[14] Fix | Delete
function __herald( $string_key ) {
[15] Fix | Delete
if ( ( $translated_string = herald_get_option( 'tr_'.$string_key ) ) && herald_get_option( 'enable_translate' ) ) {
[16] Fix | Delete
[17] Fix | Delete
if ( $translated_string == '-1' ) {
[18] Fix | Delete
return "";
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
return $translated_string;
[22] Fix | Delete
[23] Fix | Delete
} else {
[24] Fix | Delete
[25] Fix | Delete
$translate = herald_get_translate_options();
[26] Fix | Delete
return $translate[$string_key]['text'];
[27] Fix | Delete
}
[28] Fix | Delete
}
[29] Fix | Delete
endif;
[30] Fix | Delete
[31] Fix | Delete
[32] Fix | Delete
[33] Fix | Delete
/**
[34] Fix | Delete
* Get featured image
[35] Fix | Delete
*
[36] Fix | Delete
* Function gets featured image depending on the size and post id.
[37] Fix | Delete
* If image is not set, it gets the default featured image placehloder from theme options.
[38] Fix | Delete
*
[39] Fix | Delete
* @param string $size Image size ID
[40] Fix | Delete
* @param int $post_id Post ID - if not passed it gets current post id by default
[41] Fix | Delete
* @param bool $ignore_default_img Wheter to apply default featured image post doesn't have featured image
[42] Fix | Delete
* @return string Image HTML output
[43] Fix | Delete
* @since 1.0
[44] Fix | Delete
*/
[45] Fix | Delete
[46] Fix | Delete
if ( !function_exists( 'herald_get_featured_image' ) ):
[47] Fix | Delete
function herald_get_featured_image( $size = 'large', $post_id = false, $ignore_default_img = false, $ignore_size_suffix = false ) {
[48] Fix | Delete
[49] Fix | Delete
global $herald_sidebar_opts, $herald_img_flag, $herald_image_matches;
[50] Fix | Delete
[51] Fix | Delete
if ( empty( $post_id ) ) {
[52] Fix | Delete
$post_id = get_the_ID();
[53] Fix | Delete
}
[54] Fix | Delete
[55] Fix | Delete
//Check if we need to force "full" or "with sidebar" size
[56] Fix | Delete
if ( (!$ignore_size_suffix && $herald_img_flag == 'full') || ( !$ignore_size_suffix && $herald_sidebar_opts['use_sidebar'] == 'none' && $herald_img_flag != 'sid' ) ) {
[57] Fix | Delete
$size .= '-full';
[58] Fix | Delete
}
[59] Fix | Delete
[60] Fix | Delete
[61] Fix | Delete
if( get_post_type() == 'attachment'){
[62] Fix | Delete
return '<img src="'.esc_attr( wp_get_attachment_url( $post_id ) ).'" alt="'.esc_attr( get_the_title( $post_id ) ).'" />';
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
//Check if has a matched image size
[66] Fix | Delete
if ( !empty( $herald_image_matches ) && array_key_exists( $size, $herald_image_matches ) ) {
[67] Fix | Delete
$size = $herald_image_matches[$size];
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
if ( has_post_thumbnail( $post_id ) ) {
[71] Fix | Delete
[72] Fix | Delete
return get_the_post_thumbnail( $post_id, $size );
[73] Fix | Delete
[74] Fix | Delete
} else if ( !$ignore_default_img && ( $placeholder = herald_get_option( 'default_fimg' ) ) ) {
[75] Fix | Delete
[76] Fix | Delete
//If there is no featured image, try to get default from theme options
[77] Fix | Delete
[78] Fix | Delete
global $placeholder_img, $placeholder_imgs;
[79] Fix | Delete
[80] Fix | Delete
if ( empty( $placeholder_img ) ) {
[81] Fix | Delete
$img_id = herald_get_image_id_by_url( $placeholder );
[82] Fix | Delete
} else {
[83] Fix | Delete
$img_id = $placeholder_img;
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
if ( !empty( $img_id ) ) {
[87] Fix | Delete
if ( !isset( $placeholder_imgs[$size] ) ) {
[88] Fix | Delete
$def_img = wp_get_attachment_image( $img_id, $size );
[89] Fix | Delete
} else {
[90] Fix | Delete
$def_img = $placeholder_imgs[$size];
[91] Fix | Delete
}
[92] Fix | Delete
[93] Fix | Delete
if ( !empty( $def_img ) ) {
[94] Fix | Delete
$placeholder_imgs[$size] = $def_img;
[95] Fix | Delete
return $def_img;
[96] Fix | Delete
}
[97] Fix | Delete
}
[98] Fix | Delete
[99] Fix | Delete
return '<img src="'.esc_attr( $placeholder ).'" alt="'.esc_attr( get_the_title( $post_id ) ).'" />';
[100] Fix | Delete
}
[101] Fix | Delete
[102] Fix | Delete
return false;
[103] Fix | Delete
}
[104] Fix | Delete
endif;
[105] Fix | Delete
[106] Fix | Delete
[107] Fix | Delete
/**
[108] Fix | Delete
* Get post categories
[109] Fix | Delete
*
[110] Fix | Delete
* Function gets categories for current post and displays and slightly modifies
[111] Fix | Delete
* HTML output of category list so we can have category id in class parameter
[112] Fix | Delete
*
[113] Fix | Delete
* @return string HTML output of category links
[114] Fix | Delete
* @since 1.0
[115] Fix | Delete
*/
[116] Fix | Delete
[117] Fix | Delete
if ( !function_exists( 'herald_get_category' ) ):
[118] Fix | Delete
function herald_get_category() {
[119] Fix | Delete
global $post;
[120] Fix | Delete
[121] Fix | Delete
$primary_category = herald_is_yoast_active() ? herald_get_option('primary_category') : false;
[122] Fix | Delete
$primary_term_id = $primary_category ? get_post_meta( $post->ID, '_yoast_wpseo_primary_category', true ) : false;
[123] Fix | Delete
$allow_on_single = is_single() && get_queried_object_id() == $post->ID;
[124] Fix | Delete
[125] Fix | Delete
if ( $primary_category && isset($primary_term_id) && !empty($primary_term_id) && !$allow_on_single ) {
[126] Fix | Delete
[127] Fix | Delete
$term = get_term( $primary_term_id );
[128] Fix | Delete
[129] Fix | Delete
if(!is_wp_error( $term ) && !empty($term)){
[130] Fix | Delete
return '<a href="'.esc_url( get_term_link( $term->term_id ) ).'" class="herald-cat-'.$term->term_id.'">'.$term->name.'</a>';
[131] Fix | Delete
}
[132] Fix | Delete
[133] Fix | Delete
return '';
[134] Fix | Delete
[135] Fix | Delete
} else {
[136] Fix | Delete
[137] Fix | Delete
$output = array();
[138] Fix | Delete
$taxs = array();
[139] Fix | Delete
$taxonomies = get_post_taxonomies( $post->ID );
[140] Fix | Delete
[141] Fix | Delete
if ( !empty( $taxonomies ) ) {
[142] Fix | Delete
[143] Fix | Delete
foreach ( $taxonomies as $tax ) {
[144] Fix | Delete
if ( is_taxonomy_hierarchical( $tax ) ) {
[145] Fix | Delete
$terms = get_the_terms( $post->ID, $tax );
[146] Fix | Delete
if ( !empty( $terms ) ) {
[147] Fix | Delete
$taxs[] = $terms;
[148] Fix | Delete
}
[149] Fix | Delete
[150] Fix | Delete
}
[151] Fix | Delete
}
[152] Fix | Delete
}
[153] Fix | Delete
[154] Fix | Delete
if ( !empty( $taxs ) ) {
[155] Fix | Delete
[156] Fix | Delete
foreach ( $taxs as $tax ) {
[157] Fix | Delete
if ( !empty( $tax ) ) {
[158] Fix | Delete
foreach ( $tax as $term ) {
[159] Fix | Delete
$output[] = '<a href="'.esc_url( get_term_link( $term->term_id ) ).'" class="herald-cat-'.$term->term_id.'">'.$term->name.'</a>';
[160] Fix | Delete
}
[161] Fix | Delete
}
[162] Fix | Delete
}
[163] Fix | Delete
[164] Fix | Delete
if ( !empty( $output ) ) {
[165] Fix | Delete
$output = implode( ' <span>&bull;</span> ', $output );
[166] Fix | Delete
return $output;
[167] Fix | Delete
}
[168] Fix | Delete
}
[169] Fix | Delete
[170] Fix | Delete
}
[171] Fix | Delete
[172] Fix | Delete
return "";
[173] Fix | Delete
}
[174] Fix | Delete
endif;
[175] Fix | Delete
[176] Fix | Delete
[177] Fix | Delete
/**
[178] Fix | Delete
* Get post meta data
[179] Fix | Delete
*
[180] Fix | Delete
* Function outputs meta data HTML based on theme options for specifi layout
[181] Fix | Delete
*
[182] Fix | Delete
* @param string $layout Layout ID
[183] Fix | Delete
* @param array $force_meta Force specific meta instead of using options
[184] Fix | Delete
* @return string HTML output of meta data
[185] Fix | Delete
* @since 1.0
[186] Fix | Delete
*/
[187] Fix | Delete
[188] Fix | Delete
if ( !function_exists( 'herald_get_meta_data' ) ):
[189] Fix | Delete
function herald_get_meta_data( $layout = 'a', $force_meta = false ) {
[190] Fix | Delete
[191] Fix | Delete
$meta_data = $force_meta !== false ? $force_meta : array_keys( array_filter( herald_get_option( 'lay_'.$layout .'_meta' ) ) );
[192] Fix | Delete
[193] Fix | Delete
$output = '';
[194] Fix | Delete
[195] Fix | Delete
if ( !empty( $meta_data ) ) {
[196] Fix | Delete
[197] Fix | Delete
$has_time = in_array( 'time', $meta_data ) ? true : false;
[198] Fix | Delete
$has_date = in_array( 'date', $meta_data ) ? true : false;
[199] Fix | Delete
$time_added = false;
[200] Fix | Delete
[201] Fix | Delete
foreach ( $meta_data as $mkey ) {
[202] Fix | Delete
[203] Fix | Delete
$meta = '';
[204] Fix | Delete
[205] Fix | Delete
switch ( $mkey ) {
[206] Fix | Delete
[207] Fix | Delete
case 'date':
[208] Fix | Delete
[209] Fix | Delete
if ( $has_time ) {
[210] Fix | Delete
$time = ' '.get_the_time();
[211] Fix | Delete
$time_added = true;
[212] Fix | Delete
} else {
[213] Fix | Delete
$time = '';
[214] Fix | Delete
}
[215] Fix | Delete
[216] Fix | Delete
$meta = '<span class="updated">'.get_the_date().$time.'</span>';
[217] Fix | Delete
break;
[218] Fix | Delete
[219] Fix | Delete
case 'modified_date':
[220] Fix | Delete
[221] Fix | Delete
if ( $has_time ) {
[222] Fix | Delete
$time = ' '.get_the_modified_time();
[223] Fix | Delete
$time_added = true;
[224] Fix | Delete
} else {
[225] Fix | Delete
$time = '';
[226] Fix | Delete
}
[227] Fix | Delete
[228] Fix | Delete
$meta = '<span class="updated">'.get_the_modified_date().$time.'</span>';
[229] Fix | Delete
break;
[230] Fix | Delete
[231] Fix | Delete
case 'time':
[232] Fix | Delete
if ( !$time_added && !$has_date ) {
[233] Fix | Delete
$meta = '<span class="updated">'.get_the_time().'</span>';
[234] Fix | Delete
}
[235] Fix | Delete
break;
[236] Fix | Delete
[237] Fix | Delete
case 'author':
[238] Fix | Delete
if ( herald_is_co_authors_active() && $coauthors_meta = get_coauthors() ) {
[239] Fix | Delete
$temp = '';
[240] Fix | Delete
foreach ( $coauthors_meta as $key ) {
[241] Fix | Delete
$temp .= '<span class="vcard author"><span class="fn"><a href="'.esc_url( get_author_posts_url( $key->ID, $key->user_nicename ) ).'">'.$key->display_name.'</a></span></span>';
[242] Fix | Delete
}
[243] Fix | Delete
$multi_class = count( $coauthors_meta ) > 1 ? "couauthors-icon" : '';
[244] Fix | Delete
$meta = '<div class="coauthors '.esc_attr( $multi_class ).'">'.$temp.'</div>';
[245] Fix | Delete
[246] Fix | Delete
[247] Fix | Delete
} else {
[248] Fix | Delete
$author_id = get_post_field( 'post_author', get_the_ID() );
[249] Fix | Delete
$meta = '<span class="vcard author"><span class="fn"><a href="'.esc_url( get_author_posts_url( get_the_author_meta( 'ID', $author_id ) ) ).'">'.get_the_author_meta( 'display_name', $author_id ).'</a></span></span>';
[250] Fix | Delete
}
[251] Fix | Delete
break;
[252] Fix | Delete
[253] Fix | Delete
case 'views':
[254] Fix | Delete
global $wp_locale;
[255] Fix | Delete
$thousands_sep = isset( $wp_locale->number_format['thousands_sep'] ) ? $wp_locale->number_format['thousands_sep'] : ',';
[256] Fix | Delete
if ( strlen( $thousands_sep ) > 1 ) {
[257] Fix | Delete
$thousands_sep = trim( $thousands_sep );
[258] Fix | Delete
}
[259] Fix | Delete
$meta = function_exists( 'ev_get_post_view_count' ) ? number_format_i18n( absint( str_replace( $thousands_sep, '', ev_get_post_view_count( get_the_ID() ) ) + absint( herald_get_option( 'views_forgery' ) ) ) ) . ' '.__herald( 'views' ) : '';
[260] Fix | Delete
break;
[261] Fix | Delete
[262] Fix | Delete
case 'rtime':
[263] Fix | Delete
$meta = herald_read_time( get_post_field( 'post_content', get_the_ID() ) );
[264] Fix | Delete
if ( !empty( $meta ) ) {
[265] Fix | Delete
$meta .= ' '.__herald( 'min_read' );
[266] Fix | Delete
}
[267] Fix | Delete
break;
[268] Fix | Delete
[269] Fix | Delete
case 'comments':
[270] Fix | Delete
if ( comments_open() || get_comments_number() ) {
[271] Fix | Delete
ob_start();
[272] Fix | Delete
comments_popup_link( __herald( 'no_comments' ), __herald( 'one_comment' ), __herald( 'multiple_comments' ) );
[273] Fix | Delete
$meta = ob_get_contents();
[274] Fix | Delete
ob_end_clean();
[275] Fix | Delete
} else {
[276] Fix | Delete
$meta = '';
[277] Fix | Delete
}
[278] Fix | Delete
break;
[279] Fix | Delete
[280] Fix | Delete
case 'reviews':
[281] Fix | Delete
$meta = '';
[282] Fix | Delete
if ( herald_is_wp_review_active() ) {
[283] Fix | Delete
$meta = function_exists( 'wp_review_show_total' ) ? wp_review_show_total( false, '' ) : '';
[284] Fix | Delete
}
[285] Fix | Delete
break;
[286] Fix | Delete
[287] Fix | Delete
default:
[288] Fix | Delete
break;
[289] Fix | Delete
}
[290] Fix | Delete
[291] Fix | Delete
if ( !empty( $meta ) ) {
[292] Fix | Delete
$output .= '<div class="meta-item herald-'.$mkey.'">'.$meta.'</div>';
[293] Fix | Delete
}
[294] Fix | Delete
}
[295] Fix | Delete
}
[296] Fix | Delete
[297] Fix | Delete
[298] Fix | Delete
return $output;
[299] Fix | Delete
[300] Fix | Delete
}
[301] Fix | Delete
endif;
[302] Fix | Delete
[303] Fix | Delete
[304] Fix | Delete
/**
[305] Fix | Delete
* Get post excerpt
[306] Fix | Delete
*
[307] Fix | Delete
* Function outputs post excerpt for specific layout
[308] Fix | Delete
*
[309] Fix | Delete
* @param string $layout Layout ID
[310] Fix | Delete
* @param string $force_meta Force specific meta instead of using options for layout
[311] Fix | Delete
* @return string HTML output of category links
[312] Fix | Delete
* @since 1.0
[313] Fix | Delete
*/
[314] Fix | Delete
[315] Fix | Delete
if ( !function_exists( 'herald_get_excerpt' ) ):
[316] Fix | Delete
function herald_get_excerpt( $layout = 'a' ) {
[317] Fix | Delete
[318] Fix | Delete
$manual_excerpt = false;
[319] Fix | Delete
[320] Fix | Delete
if ( has_excerpt() ) {
[321] Fix | Delete
$content = get_the_excerpt();
[322] Fix | Delete
$manual_excerpt = true;
[323] Fix | Delete
} else {
[324] Fix | Delete
$text = get_the_content( '' );
[325] Fix | Delete
$text = strip_shortcodes( $text );
[326] Fix | Delete
$text = apply_filters( 'the_content', $text );
[327] Fix | Delete
$content = str_replace( ']]>', ']]&gt;', $text );
[328] Fix | Delete
}
[329] Fix | Delete
[330] Fix | Delete
[331] Fix | Delete
if ( !empty( $content ) ) {
[332] Fix | Delete
$limit = herald_get_option( 'lay_'.$layout.'_excerpt_limit' );
[333] Fix | Delete
if ( !empty( $limit ) || !$manual_excerpt ) {
[334] Fix | Delete
$more = herald_get_option( 'more_string' );
[335] Fix | Delete
$content = wp_strip_all_tags( $content );
[336] Fix | Delete
$content = preg_replace( '/\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i', '', $content );
[337] Fix | Delete
$content = herald_trim_chars( $content, $limit, $more );
[338] Fix | Delete
}
[339] Fix | Delete
return wpautop( $content );
[340] Fix | Delete
}
[341] Fix | Delete
[342] Fix | Delete
return '';
[343] Fix | Delete
[344] Fix | Delete
}
[345] Fix | Delete
endif;
[346] Fix | Delete
[347] Fix | Delete
[348] Fix | Delete
/**
[349] Fix | Delete
* Get archive heading
[350] Fix | Delete
*
[351] Fix | Delete
* Function gets title and description for current template
[352] Fix | Delete
*
[353] Fix | Delete
* @return string Uses herald_print_heading() to generate HTML output
[354] Fix | Delete
* @since 1.0
[355] Fix | Delete
*/
[356] Fix | Delete
[357] Fix | Delete
if ( !function_exists( 'herald_get_archive_heading' ) ):
[358] Fix | Delete
function herald_get_archive_heading() {
[359] Fix | Delete
if ( is_category() ) {
[360] Fix | Delete
[361] Fix | Delete
$obj = get_queried_object();
[362] Fix | Delete
[363] Fix | Delete
$args['title'] = __herald( 'category' ).single_cat_title( '', false );
[364] Fix | Delete
[365] Fix | Delete
$args['desc'] = herald_get_option( 'category_desc' ) ? category_description() : '';
[366] Fix | Delete
$args['cat'] = $obj->term_id;
[367] Fix | Delete
[368] Fix | Delete
if ( herald_get_option( 'category_sub' ) ) {
[369] Fix | Delete
[370] Fix | Delete
$sub = get_categories( array( 'parent' => $obj->term_id, 'hide_empty' => false ) );
[371] Fix | Delete
[372] Fix | Delete
if ( !empty( $sub ) ) {
[373] Fix | Delete
$args['subnav'] = '';
[374] Fix | Delete
foreach ( $sub as $child ) {
[375] Fix | Delete
$args['subnav'] .= '<a href="'.esc_url( get_category_link( $child ) ).'">'.$child->name.'</a>';
[376] Fix | Delete
}
[377] Fix | Delete
$args['title'] .= '<i class="fa fa-angle-down herald-sub-cat-icon" aria-hidden="true"></i><div class="herald-mod-subnav-mobile">'.$args['subnav'].'</div>';
[378] Fix | Delete
}
[379] Fix | Delete
[380] Fix | Delete
if ( !empty( $obj->parent ) ) {
[381] Fix | Delete
$parent = get_category( $obj->parent );
[382] Fix | Delete
$args['actions'] = '<a href="'.esc_url( get_category_link( $parent->term_id ) ).'">'.$parent->name.'</a>';
[383] Fix | Delete
}
[384] Fix | Delete
[385] Fix | Delete
[386] Fix | Delete
}
[387] Fix | Delete
[388] Fix | Delete
[389] Fix | Delete
[390] Fix | Delete
} else if ( is_author() ) {
[391] Fix | Delete
[392] Fix | Delete
$obj = get_queried_object();
[393] Fix | Delete
[394] Fix | Delete
if ( empty( $obj ) ) {
[395] Fix | Delete
global $author;
[396] Fix | Delete
$obj = isset( $_GET['author_name'] ) ? get_user_by( 'slug', $author_name ) : get_userdata( intval( $author ) );
[397] Fix | Delete
}
[398] Fix | Delete
[399] Fix | Delete
if ( herald_is_co_authors_active() ) {
[400] Fix | Delete
[401] Fix | Delete
$args['title'] = __herald( 'author' ).$obj->display_name;
[402] Fix | Delete
[403] Fix | Delete
if ( herald_get_option( 'author_desc' ) ) {
[404] Fix | Delete
$args['desc'] = wpautop( get_avatar( $obj->ID, 80 ) . get_the_author_meta( 'description' ) );
[405] Fix | Delete
}
[406] Fix | Delete
[407] Fix | Delete
if ( herald_get_option( 'author_social' ) ) {
[408] Fix | Delete
$args['subnav'] = herald_get_author_social( $obj->ID );
[409] Fix | Delete
}
[410] Fix | Delete
} else {
[411] Fix | Delete
[412] Fix | Delete
$args['title'] = __herald( 'author' ).$obj->display_name;
[413] Fix | Delete
[414] Fix | Delete
if ( herald_get_option( 'author_desc' ) ) {
[415] Fix | Delete
$args['desc'] = wpautop( get_avatar( $obj->ID, 80 ) . get_the_author_meta( 'description', $obj->ID ) );
[416] Fix | Delete
}
[417] Fix | Delete
[418] Fix | Delete
if ( herald_get_option( 'author_social' ) ) {
[419] Fix | Delete
$args['subnav'] = herald_get_author_social( $obj->ID );
[420] Fix | Delete
}
[421] Fix | Delete
}
[422] Fix | Delete
[423] Fix | Delete
} else if ( is_tax() ) {
[424] Fix | Delete
$args['title'] = single_term_title( '', false );
[425] Fix | Delete
} else if ( is_home() && ( $posts_page = get_option( 'page_for_posts' ) ) && !is_page_template( 'template-modules.php' ) ) {
[426] Fix | Delete
$args['title'] = get_the_title( $posts_page );
[427] Fix | Delete
} else if ( is_search() ) {
[428] Fix | Delete
$args['title'] = __herald( 'search_results_for' ).get_search_query();
[429] Fix | Delete
$args['desc'] = get_search_form( false );
[430] Fix | Delete
} else if ( is_tag() ) {
[431] Fix | Delete
$args['title'] = __herald( 'tag' ).single_tag_title( '', false );
[432] Fix | Delete
$args['desc'] = tag_description();
[433] Fix | Delete
} else if ( is_day() ) {
[434] Fix | Delete
$args['title'] = __herald( 'archive' ).get_the_date();
[435] Fix | Delete
} else if ( is_month() ) {
[436] Fix | Delete
$args['title'] = __herald( 'archive' ).get_the_date( 'F Y' );
[437] Fix | Delete
} else if ( is_year() ) {
[438] Fix | Delete
$args['title'] = __herald( 'archive' ).get_the_date( 'Y' );
[439] Fix | Delete
} else {
[440] Fix | Delete
$args['title'] = '';
[441] Fix | Delete
$args['desc'] = '';
[442] Fix | Delete
}
[443] Fix | Delete
[444] Fix | Delete
if ( !empty( $args['title'] ) ) {
[445] Fix | Delete
$args['title'] = '<h1 class="h6 herald-mod-h herald-color">'.$args['title'].'</h1>';
[446] Fix | Delete
}
[447] Fix | Delete
[448] Fix | Delete
if ( !empty( $args['desc'] ) ) {
[449] Fix | Delete
$args['desc'] = wpautop( $args['desc'] );
[450] Fix | Delete
}
[451] Fix | Delete
[452] Fix | Delete
return herald_print_heading( $args );
[453] Fix | Delete
}
[454] Fix | Delete
endif;
[455] Fix | Delete
[456] Fix | Delete
[457] Fix | Delete
/**
[458] Fix | Delete
* Get post format icon
[459] Fix | Delete
*
[460] Fix | Delete
* Checks format of current post and returns icon class.
[461] Fix | Delete
*
[462] Fix | Delete
* @return string Icon HTML output
[463] Fix | Delete
* @since 1.0
[464] Fix | Delete
*/
[465] Fix | Delete
[466] Fix | Delete
if ( !function_exists( 'herald_post_format_icon' ) ):
[467] Fix | Delete
function herald_post_format_icon() {
[468] Fix | Delete
[469] Fix | Delete
$format = get_post_format();
[470] Fix | Delete
[471] Fix | Delete
$icons = array(
[472] Fix | Delete
'video' => 'fa-play',
[473] Fix | Delete
'audio' => 'fa-volume-up',
[474] Fix | Delete
'image' => 'fa-picture-o',
[475] Fix | Delete
'gallery' => 'fa-camera'
[476] Fix | Delete
);
[477] Fix | Delete
[478] Fix | Delete
//Allow plugins or child themes to modify icons
[479] Fix | Delete
$icons = apply_filters( 'herald_post_format_icons', $icons );
[480] Fix | Delete
[481] Fix | Delete
if ( $format && array_key_exists( $format, $icons ) ) {
[482] Fix | Delete
[483] Fix | Delete
return '<span class="herald-format-icon"><i class="fa '.esc_attr( $icons[$format] ).'"></i></span>';
[484] Fix | Delete
}
[485] Fix | Delete
[486] Fix | Delete
return '';
[487] Fix | Delete
}
[488] Fix | Delete
endif;
[489] Fix | Delete
[490] Fix | Delete
[491] Fix | Delete
/**
[492] Fix | Delete
* Get post display option
[493] Fix | Delete
*
[494] Fix | Delete
* Checks if specific option is ovewritten in single post
[495] Fix | Delete
* so we know if we pull this options from global options or particular post
[496] Fix | Delete
*
[497] Fix | Delete
* @param string $option Option id string
[498] Fix | Delete
* @param int $post_id
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function