', esc_url( get_bloginfo( 'pingback_url' ) ) ); } } add_action( 'wp_head', 'bloghub_pingback_header' ); /** * Allow Html */ if ( !function_exists( 'bloghub_allow_html' ) ) { function bloghub_allow_html(){ return array( 'a' => array( 'href' => array(), 'target' => array(), 'title' => array(), 'rel' => array(), ), 'strong' => array(), 'small' => array(), 'span' => array( 'style' => array(), ), 'p' => array(), 'br' => array(), 'img' => array( 'src' => array(), 'title' => array(), 'alt' => array(), 'width' => array(), 'height' => array(), 'class' => array(), ), 'h1' => array(), 'h2' => array(), 'h3' => array(), 'h4' => array(), 'h5' => array(), 'h6' => array(), ); } } /** * Add span tag in archive list count number */ function bloghub_add_span_archive_count($links) { $links = str_replace(' (', ' (', $links); $links = str_replace(')', ')', $links); return $links; } add_filter('get_archives_link', 'bloghub_add_span_archive_count'); /** * Add span tag in category list count number */ function bloghub_add_span_category_count($links) { $links = str_replace(' (', ' (', $links); $links = str_replace(')', ')', $links); return $links; } add_filter('wp_list_categories', 'bloghub_add_span_category_count'); /** * Prints HTML with meta information for the current post-date/time. */ if ( ! function_exists( 'bloghub_posted_on' ) ) : function bloghub_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( DATE_W3C ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( DATE_W3C ) ), esc_html( get_the_modified_date() ) ); $posted_on = sprintf( /* translators: %s: post date. */ esc_html_x( ' %s', 'post date', 'bloghub' ), // phpcs:ignore WordPress.WP.I18n.NoEmptyStrings '' . $time_string . '' ); echo '' . $posted_on . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; /** * Prints HTML with meta information for the current author. */ if ( ! function_exists( 'bloghub_posted_by' ) ) : function bloghub_posted_by() { $byline = sprintf( /* translators: %s: post author. */ esc_html_x( ' %s', 'post author', 'bloghub' ), // phpcs:ignore WordPress.WP.I18n.NoEmptyStrings '' ); echo ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; /** * Prints HTML with meta information for the tags. */ if ( ! function_exists( 'bloghub_post_tags' ) ) : function bloghub_post_tags() { // Hide category and tag text for pages. if ( 'post' === get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list('', esc_html_x('', 'list item separator', 'bloghub')); // phpcs:ignore WordPress.WP.I18n.NoEmptyStrings if ($tags_list) { /* translators: 1: list of tags. */ printf('', $tags_list); // phpcs:ignore WordPress.WP.I18n.NoEmptyStrings } } } endif; /** * Prints HTML with meta information for the categories. */ if ( ! function_exists( 'bloghub_post_categories' ) ) : function bloghub_post_categories() { if ( 'post' === get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list(esc_html__(', ', 'bloghub')); if ($categories_list) { /* translators: 1: list of categories. */ printf('' . esc_html__('%1$s', 'bloghub') . '', $categories_list); // phpcs:ignore WordPress.WP.I18n.NoEmptyStrings } } } endif; /** * Prints HTML with meta information for the comments. */ if ( ! function_exists( 'bloghub_comment_count' ) ) : function bloghub_comment_count() { if ( ! post_password_required() && ( comments_open() || get_comments_number() ) && get_comments_number() != 0) { echo ''; comments_popup_link('', ''.esc_html__('1', 'bloghub').' '.esc_html__('Comment', 'bloghub').'', '% '.esc_html__('Comments', 'bloghub').''); echo ''; } } endif; if ( ! function_exists( 'bloghub_entry_footer' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. */ function bloghub_entry_footer() { edit_post_link( sprintf( wp_kses( /* translators: %s: Name of current post. Only visible to screen readers */ __( 'Edit %s', 'bloghub' ), array( 'span' => array( 'class' => array(), ), ) ), wp_kses_post( get_the_title() ) ), '', '' ); } endif; if ( ! function_exists( 'bloghub_post_thumbnail' ) ) : /** * Displays an optional post thumbnail. * * Wraps the post thumbnail in an anchor element on index views, or a div * element when on single views. */ function bloghub_post_thumbnail() { if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { return; } if ( is_singular() ) : ?>