: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* @return mixed Option value
if ( !function_exists( 'herald_get_post_display' ) ):
function herald_get_post_display( $option = false, $post_id = false ) {
if ( empty( $option ) ) {
$meta = herald_get_post_meta( $post_id, 'display' );
if ( in_array( $option, array( 'ad_below', 'ad_above' ) ) ) {
if ( array_key_exists( $option, $meta ) ) {
$value = $meta[$option] == 'inherit' ? herald_get_option( 'single_'.$option ) : $meta[$option];
* Get single post content class
* Checks if meta bar is enabled and returns proper Bootstrap wrapper classes
* @return string Output of classes
if ( !function_exists( 'herald_single_content_class' ) ):
function herald_single_content_class() {
$meta_bar_position = herald_get_single_meta_bar_position();
return $meta_bar_position != 'none' ? 'col-lg-10 col-md-10 col-sm-10' : 'col-lg-12 col-md-12 col-sm-12';
* @param bool $echo Whether to output HTML or not
* @return string|void Return or echo HTML output
if ( !function_exists( 'herald_breadcrumbs' ) ):
function herald_breadcrumbs( $echo = true ) {
if ( function_exists( 'yoast_breadcrumb' ) ) {
$breadcrumbs = yoast_breadcrumb( '<div id="herald-breadcrumbs" class="herald-breadcrumbs">', '</div>', false );
echo wp_kses_post( $breadcrumbs );
* Return category image or if is not set category image return last post feature image
if ( !function_exists('herald_get_category_featured_image') ) :
function herald_get_category_featured_image($size, $cat_id){
global $herald_sidebar_opts, $herald_img_flag, $herald_image_matches;
if ( empty( $cat_id ) ) {
$cat_id = get_queried_object_id();
if ( $herald_img_flag == 'full' || ( $herald_sidebar_opts['use_sidebar'] == 'none' && $herald_img_flag != 'sid' ) ) {
if ( !empty( $herald_image_matches ) && array_key_exists( $size, $herald_image_matches ) ) {
$size = $herald_image_matches[$size];
$img_url = herald_get_category_meta( $cat_id, 'image' );
if ( !empty( $img_url ) ) {
$img_id = herald_get_image_id_by_url( $img_url );
$img_html = wp_get_attachment_image( $img_id, $size );
if ( empty( $img_html ) ) {
$img_html = '<img src="'.esc_url( $img_url ).'"/>';
if ( empty( $img_html ) ) {
$first_post = herald_get_first_post_in_category($cat_id);
if (!empty($first_post) && isset($first_post->ID)) {
$post_id = $first_post->ID;
$img_html = herald_get_featured_image( $size, $post_id, false, true);
return wp_kses_post( $img_html );
* Return author social links
if ( !function_exists('herald_get_author_social_links') ) :
function herald_get_author_social_links($author_id){
if ( empty($author_id) ) {
$social_links = array_filter( herald_get_option('single_author_social_links') );
if ( empty($social_links) ) {
foreach ( $social_links as $key => $value ) {
$social_url = get_the_author_meta( $key, $author_id );
if ( empty($social_url) ) {
$pos = strpos( $social_url, '@');
$social_url = 'https://twitter.com/'.substr( $social_url, $pos, strlen( $social_url ) );
$output .= '<a class="herald-author-twitter" href="'.esc_url( $social_url ).'" target="_blank">'.basename($social_url).'</a>';
$output .= '<a class="herald-author-twitter herald-author-'.esc_attr($key).'" href="'.esc_url( $social_url ).'" target="_blank">'.basename($social_url).'</a>';
$social_url = 'https://instagram.com/'.substr( $social_url, 1 );
$output .= '<a class="herald-author-twitter herald-author-'.esc_attr($key).'" href="'.esc_url( $social_url ).'" target="_blank">'.basename( $social_url ).'</a>';
if(!function_exists('herald_can_display_ads')):
function herald_can_display_ads(){
if(is_404() && herald_get_option('ad_exclude_404')){
$exclude_ids_option = herald_get_option('ad_exclude_from_pages');
$exclude_ids = !empty($exclude_ids_option) ? $exclude_ids_option : array();
if(is_page() && in_array(get_queried_object_id(), $exclude_ids)){
* Check if post or page are using clear blur
if(!function_exists('herald_has_clear_blur')):
function herald_has_clear_blur(){
if(get_page_template_slug() == 'template-full-width.php'){
$layout = herald_get_page_layout();
if(in_array($layout, array('3', '6'))){
$layout = herald_get_single_layout();
if(in_array($layout, array('3', '6', '9'))){