' . $first_paragraph_str . '
'; } endif; if (!function_exists('the_newsmag_status_post_format_avatar_image')) : function the_newsmag_status_post_format_avatar_image() { return get_avatar(get_the_author_meta('user_email'), '75'); } endif; // quote post format support added if (!function_exists('the_newsmag_quote_post_format_blockquote')) : function the_newsmag_quote_post_format_blockquote() { $document = new DOMDocument(); $content = apply_filters('the_content', get_the_content('', true)); $output = ''; if ('' != $content) { libxml_use_internal_errors(true); $document->loadHTML(mb_convert_encoding($content, 'html-entities', 'utf-8')); libxml_clear_errors(); $blockquotes = $document->getElementsByTagName('blockquote'); if ($blockquotes->length) { $blockquote = $blockquotes->item(0); $document = new DOMDocument(); $document->appendChild($document->importNode($blockquote, true)); $output .= $document->saveHTML(); } } return wpautop($output); } endif; // audio and video post format support added if (!function_exists('the_newsmag_audio_video_post_format')) : function the_newsmag_audio_video_post_format() { $document = new DOMDocument(); $content = apply_filters('the_content', get_the_content('', true)); if ('' != $content) { libxml_use_internal_errors(true); $document->loadHTML($content); libxml_clear_errors(); $iframes = $document->getElementsByTagName('iframe'); $objects = $document->getElementsByTagName('object'); $embeds = $document->getElementsByTagName('embed'); $document = new DOMDocument(); if ($iframes->length) { $iframe = $iframes->item($iframes->length - 1); $document->appendChild($document->importNode($iframe, true)); } elseif ($objects->length) { $object = $objects->item($objects->length - 1); $document->appendChild($document->importNode($object, true)); } elseif ($embeds->length) { $embed = $embeds->item($embeds->length - 1); $document->appendChild($document->importNode($embed, true)); } return wpautop($document->saveHTML()); } return false; } endif; if (!function_exists('the_newsmag_widget_posts_posted_on')) : /** * Prints HTML with meta information for the current post-date/time and author. */ function the_newsmag_widget_posts_posted_on() { $time_string = ''; if (get_the_time('U') !== get_the_modified_time('U')) { $time_string = ''; } $time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()) ); $posted_on = sprintf( esc_html_x('%s', 'post date', 'the-newsmag'), '' . '' . $time_string . '' ); $byline = sprintf( esc_html_x('%s', 'post author', 'the-newsmag'), '' . get_avatar(get_the_author_meta('user_email'), '25') . '' . ' ' ); echo ' '; echo '' . $posted_on . ''; // WPCS: XSS OK. if (!post_password_required() && (comments_open() || get_comments_number())) : ?> 1', ' %1$s', get_comments_number(), 'comments title', 'the-newsmag'), number_format_i18n(get_comments_number())); ?>