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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/herald/core
File: template-functions.php
* @return mixed Option value
[500] Fix | Delete
* @since 1.3
[501] Fix | Delete
*/
[502] Fix | Delete
[503] Fix | Delete
if ( !function_exists( 'herald_get_post_display' ) ):
[504] Fix | Delete
function herald_get_post_display( $option = false, $post_id = false ) {
[505] Fix | Delete
[506] Fix | Delete
if ( empty( $option ) ) {
[507] Fix | Delete
return false;
[508] Fix | Delete
}
[509] Fix | Delete
[510] Fix | Delete
if ( !$post_id ) {
[511] Fix | Delete
$post_id = get_the_ID();
[512] Fix | Delete
}
[513] Fix | Delete
[514] Fix | Delete
$meta = herald_get_post_meta( $post_id, 'display' );
[515] Fix | Delete
[516] Fix | Delete
if ( in_array( $option, array( 'ad_below', 'ad_above' ) ) ) {
[517] Fix | Delete
return $meta[$option];
[518] Fix | Delete
}
[519] Fix | Delete
[520] Fix | Delete
if ( array_key_exists( $option, $meta ) ) {
[521] Fix | Delete
$value = $meta[$option] == 'inherit' ? herald_get_option( 'single_'.$option ) : $meta[$option];
[522] Fix | Delete
return $value;
[523] Fix | Delete
}
[524] Fix | Delete
[525] Fix | Delete
return false;
[526] Fix | Delete
}
[527] Fix | Delete
endif;
[528] Fix | Delete
[529] Fix | Delete
[530] Fix | Delete
/**
[531] Fix | Delete
* Get single post content class
[532] Fix | Delete
*
[533] Fix | Delete
* Checks if meta bar is enabled and returns proper Bootstrap wrapper classes
[534] Fix | Delete
*
[535] Fix | Delete
* @return string Output of classes
[536] Fix | Delete
* @since 1.4
[537] Fix | Delete
*/
[538] Fix | Delete
[539] Fix | Delete
if ( !function_exists( 'herald_single_content_class' ) ):
[540] Fix | Delete
function herald_single_content_class() {
[541] Fix | Delete
$meta_bar_position = herald_get_single_meta_bar_position();
[542] Fix | Delete
return $meta_bar_position != 'none' ? 'col-lg-10 col-md-10 col-sm-10' : 'col-lg-12 col-md-12 col-sm-12';
[543] Fix | Delete
}
[544] Fix | Delete
endif;
[545] Fix | Delete
[546] Fix | Delete
[547] Fix | Delete
/**
[548] Fix | Delete
* Breadcrumbs
[549] Fix | Delete
*
[550] Fix | Delete
* @param bool $echo Whether to output HTML or not
[551] Fix | Delete
* @return string|void Return or echo HTML output
[552] Fix | Delete
* @since 1.4
[553] Fix | Delete
*/
[554] Fix | Delete
[555] Fix | Delete
if ( !function_exists( 'herald_breadcrumbs' ) ):
[556] Fix | Delete
function herald_breadcrumbs( $echo = true ) {
[557] Fix | Delete
$breadcrumbs = '';
[558] Fix | Delete
[559] Fix | Delete
if ( function_exists( 'yoast_breadcrumb' ) ) {
[560] Fix | Delete
$breadcrumbs = yoast_breadcrumb( '<div id="herald-breadcrumbs" class="herald-breadcrumbs">', '</div>', false );
[561] Fix | Delete
}
[562] Fix | Delete
[563] Fix | Delete
if ( $echo ) {
[564] Fix | Delete
echo wp_kses_post( $breadcrumbs );
[565] Fix | Delete
} else {
[566] Fix | Delete
return $breadcrumbs;
[567] Fix | Delete
}
[568] Fix | Delete
[569] Fix | Delete
}
[570] Fix | Delete
endif;
[571] Fix | Delete
[572] Fix | Delete
/**
[573] Fix | Delete
* Return category image or if is not set category image return last post feature image
[574] Fix | Delete
*
[575] Fix | Delete
* @since 2.1
[576] Fix | Delete
*
[577] Fix | Delete
* @return mixed html
[578] Fix | Delete
*/
[579] Fix | Delete
[580] Fix | Delete
if ( !function_exists('herald_get_category_featured_image') ) :
[581] Fix | Delete
function herald_get_category_featured_image($size, $cat_id){
[582] Fix | Delete
[583] Fix | Delete
global $herald_sidebar_opts, $herald_img_flag, $herald_image_matches;
[584] Fix | Delete
[585] Fix | Delete
if ( empty( $cat_id ) ) {
[586] Fix | Delete
$cat_id = get_queried_object_id();
[587] Fix | Delete
}
[588] Fix | Delete
[589] Fix | Delete
if ( $herald_img_flag == 'full' || ( $herald_sidebar_opts['use_sidebar'] == 'none' && $herald_img_flag != 'sid' ) ) {
[590] Fix | Delete
$size .= '-full';
[591] Fix | Delete
}
[592] Fix | Delete
[593] Fix | Delete
if ( !empty( $herald_image_matches ) && array_key_exists( $size, $herald_image_matches ) ) {
[594] Fix | Delete
$size = $herald_image_matches[$size];
[595] Fix | Delete
}
[596] Fix | Delete
[597] Fix | Delete
$img_url = herald_get_category_meta( $cat_id, 'image' );
[598] Fix | Delete
[599] Fix | Delete
$img_html = '';
[600] Fix | Delete
[601] Fix | Delete
if ( !empty( $img_url ) ) {
[602] Fix | Delete
$img_id = herald_get_image_id_by_url( $img_url );
[603] Fix | Delete
$img_html = wp_get_attachment_image( $img_id, $size );
[604] Fix | Delete
if ( empty( $img_html ) ) {
[605] Fix | Delete
$img_html = '<img src="'.esc_url( $img_url ).'"/>';
[606] Fix | Delete
}
[607] Fix | Delete
}
[608] Fix | Delete
[609] Fix | Delete
if ( empty( $img_html ) ) {
[610] Fix | Delete
$first_post = herald_get_first_post_in_category($cat_id);
[611] Fix | Delete
$post_id = false;
[612] Fix | Delete
if (!empty($first_post) && isset($first_post->ID)) {
[613] Fix | Delete
$post_id = $first_post->ID;
[614] Fix | Delete
}
[615] Fix | Delete
$img_html = herald_get_featured_image( $size, $post_id, false, true);
[616] Fix | Delete
}
[617] Fix | Delete
[618] Fix | Delete
return wp_kses_post( $img_html );
[619] Fix | Delete
}
[620] Fix | Delete
endif;
[621] Fix | Delete
[622] Fix | Delete
/**
[623] Fix | Delete
* Return author social links
[624] Fix | Delete
*
[625] Fix | Delete
* @since 2.1
[626] Fix | Delete
*
[627] Fix | Delete
* @param int $author_id
[628] Fix | Delete
* @return mixed html
[629] Fix | Delete
*/
[630] Fix | Delete
[631] Fix | Delete
if ( !function_exists('herald_get_author_social_links') ) :
[632] Fix | Delete
function herald_get_author_social_links($author_id){
[633] Fix | Delete
[634] Fix | Delete
if ( empty($author_id) ) {
[635] Fix | Delete
return false;
[636] Fix | Delete
}
[637] Fix | Delete
[638] Fix | Delete
$output = '';
[639] Fix | Delete
[640] Fix | Delete
$social_links = array_filter( herald_get_option('single_author_social_links') );
[641] Fix | Delete
[642] Fix | Delete
[643] Fix | Delete
if ( empty($social_links) ) {
[644] Fix | Delete
return $output;
[645] Fix | Delete
}
[646] Fix | Delete
[647] Fix | Delete
foreach ( $social_links as $key => $value ) {
[648] Fix | Delete
[649] Fix | Delete
$social_url = get_the_author_meta( $key, $author_id );
[650] Fix | Delete
[651] Fix | Delete
if ( empty($social_url) ) {
[652] Fix | Delete
continue;
[653] Fix | Delete
}
[654] Fix | Delete
[655] Fix | Delete
[656] Fix | Delete
$pos = strpos( $social_url, '@');
[657] Fix | Delete
[658] Fix | Delete
switch ($key) {
[659] Fix | Delete
case 'twitter':
[660] Fix | Delete
if ($pos !== false){
[661] Fix | Delete
$social_url = 'https://twitter.com/'.substr( $social_url, $pos, strlen( $social_url ) );
[662] Fix | Delete
}
[663] Fix | Delete
$output .= '<a class="herald-author-twitter" href="'.esc_url( $social_url ).'" target="_blank">'.basename($social_url).'</a>';
[664] Fix | Delete
break;
[665] Fix | Delete
[666] Fix | Delete
case 'facebook':
[667] Fix | Delete
$output .= '<a class="herald-author-twitter herald-author-'.esc_attr($key).'" href="'.esc_url( $social_url ).'" target="_blank">'.basename($social_url).'</a>';
[668] Fix | Delete
break;
[669] Fix | Delete
[670] Fix | Delete
case 'instagram':
[671] Fix | Delete
if ($pos !== false){
[672] Fix | Delete
$social_url = 'https://instagram.com/'.substr( $social_url, 1 );
[673] Fix | Delete
}
[674] Fix | Delete
$output .= '<a class="herald-author-twitter herald-author-'.esc_attr($key).'" href="'.esc_url( $social_url ).'" target="_blank">'.basename( $social_url ).'</a>';
[675] Fix | Delete
break;
[676] Fix | Delete
[677] Fix | Delete
default:
[678] Fix | Delete
break;
[679] Fix | Delete
}
[680] Fix | Delete
[681] Fix | Delete
}
[682] Fix | Delete
[683] Fix | Delete
return $output;
[684] Fix | Delete
}
[685] Fix | Delete
endif;
[686] Fix | Delete
[687] Fix | Delete
/**
[688] Fix | Delete
* Display ads
[689] Fix | Delete
*
[690] Fix | Delete
* @since 2.1
[691] Fix | Delete
*
[692] Fix | Delete
* @return boolean
[693] Fix | Delete
*/
[694] Fix | Delete
if(!function_exists('herald_can_display_ads')):
[695] Fix | Delete
function herald_can_display_ads(){
[696] Fix | Delete
if(is_404() && herald_get_option('ad_exclude_404')){
[697] Fix | Delete
return false;
[698] Fix | Delete
}
[699] Fix | Delete
[700] Fix | Delete
$exclude_ids_option = herald_get_option('ad_exclude_from_pages');
[701] Fix | Delete
$exclude_ids = !empty($exclude_ids_option) ? $exclude_ids_option : array();
[702] Fix | Delete
[703] Fix | Delete
if(is_page() && in_array(get_queried_object_id(), $exclude_ids)){
[704] Fix | Delete
return false;
[705] Fix | Delete
}
[706] Fix | Delete
[707] Fix | Delete
return true;
[708] Fix | Delete
}
[709] Fix | Delete
endif;
[710] Fix | Delete
[711] Fix | Delete
/**
[712] Fix | Delete
* Check if post or page are using clear blur
[713] Fix | Delete
*
[714] Fix | Delete
* @since 2.1
[715] Fix | Delete
* @return boolean
[716] Fix | Delete
*/
[717] Fix | Delete
if(!function_exists('herald_has_clear_blur')):
[718] Fix | Delete
function herald_has_clear_blur(){
[719] Fix | Delete
[720] Fix | Delete
if(get_page_template_slug() == 'template-full-width.php'){
[721] Fix | Delete
return false;
[722] Fix | Delete
}
[723] Fix | Delete
[724] Fix | Delete
if(is_page()){
[725] Fix | Delete
$layout = herald_get_page_layout();
[726] Fix | Delete
[727] Fix | Delete
if(in_array($layout, array('3', '6'))){
[728] Fix | Delete
return true;
[729] Fix | Delete
}
[730] Fix | Delete
}
[731] Fix | Delete
[732] Fix | Delete
if(is_single()){
[733] Fix | Delete
$layout = herald_get_single_layout();
[734] Fix | Delete
[735] Fix | Delete
if(in_array($layout, array('3', '6', '9'))){
[736] Fix | Delete
return true;
[737] Fix | Delete
}
[738] Fix | Delete
}
[739] Fix | Delete
[740] Fix | Delete
return false;
[741] Fix | Delete
}
[742] Fix | Delete
endif;
[743] Fix | Delete
?>
[744] Fix | Delete
[745] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function