' . $logo . '' : $logo; } elseif ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) { // Copied from jetpack_the_site_logo() function. $logo = site_logo()->logo; $logo_id = get_theme_mod( 'custom_logo' ); // Check for WP 4.5 Site Logo $logo_id = $logo_id ? $logo_id : $logo['id']; // Use WP Core logo if present, otherwise use Jetpack's. $size = site_logo()->theme_size(); $html = sprintf( '', esc_url( home_url( '/' ) ), wp_get_attachment_image( $logo_id, $size, false, array( 'class' => 'site-logo attachment-' . $size, 'data-size' => $size, 'itemprop' => 'logo' ) ) ); $html = apply_filters( 'jetpack_the_site_logo', $html, $logo, $size ); } else { $tag = is_home() || is_page_template( 'template-homepage.php' ) ? 'h1' : 'h2'; $html = '<' . esc_attr( $tag ) . ' class="beta site-title">' . esc_html( get_bloginfo( 'name' ) ) . ''; if ( '' !== get_bloginfo( 'description' ) ) { $html .= '

' . esc_html( get_bloginfo( 'description', 'display' ) ) . '

'; } } if ( ! $echo ) { return $html; } echo $html; } } if ( ! function_exists( 'basepress_primary_navigation' ) ) { function basepress_primary_navigation() { if ( has_nav_menu( 'primary' ) ) : ?> ' . wp_list_pages( 'title_li=&echo=0' ) . ''; } endif; if ( ! function_exists( 'basepress_category_navigation' ) ) { function basepress_category_navigation() { ?>
'none', 'custom_header_hide' => false, 'custom_header_link' => '' )); // Display featured image as header image on static pages if( is_page() && has_post_thumbnail() ) : ?> Header elseif( get_header_image() ) : // Hide header image on front page if ( true == $theme_options['custom_header_hide'] and ( is_front_page() || is_archive() || is_search() ) ) { return; } ?>
'' ) : ?>
__( '', 'basepress' ), 'next_text' => __( '', 'basepress' ), 'before_page_number' => '' . __( 'Page', 'basepress' ) . ' ', ) ); } endif; if ( ! function_exists( 'basepress_post_header' ) ) { /** * Display the post header with a link to the single post * * @since 1.0.0 */ function basepress_post_header() { do_action( 'basepress_before_post_title'); if ( is_single() ) { the_title( '

', '

' ); } else { the_title( sprintf( '

', esc_url( get_permalink() ) ), '

' ); } do_action( 'basepress_after_post_title'); } } if ( ! function_exists('basepress_post_header_wrapper') ) { function basepress_post_header_wrapper() { echo '
'; } } if ( ! function_exists('basepress_post_header_wrapper_close') ) { function basepress_post_header_wrapper_close() { echo '
'; } } if ( ! function_exists( 'basepress_homepage_content' ) ) { /** * Display homepage content * Hooked into the `homepage` action in the homepage template * * @since 1.0.0 * @return void */ function basepress_homepage_content() { while ( have_posts() ) { the_post(); get_template_part( 'template-parts/content', 'page' ); } // end of the loop. } } if ( ! function_exists( 'basepress_post_content' ) ) { /** * Display the post content with a link to the single post * * @since 1.0.0 */ function basepress_post_content() { $size = apply_filters('basepress_thunmbnail_size', 'large'); $basepress_display_excerpt = apply_filters('basepress_display_excerpt', true); /** * Functions hooked in to basepress_post_content_before action. * * @hooked basepress_post_thumbnail - 10 */ do_action( 'basepress_post_content_before', $size); echo '
'; if ( $basepress_display_excerpt ) { the_excerpt(); } else { the_content( sprintf( /* translators: %s: Name of current post. */ wp_kses( __( 'Continue Reading %s ', 'basepress' ), array( 'span' => array( 'class' => array() ) ) ), the_title( '"', '"', false ) ) ); } echo '
'; /** * Functions hooked in basepress_post_content_after * * @hooked basepress_entry_meta_footer - 10 */ do_action( 'basepress_post_content_after' ); wp_link_pages( array( 'before' => '', ) ); } } if ( ! function_exists( 'basepress_post_single_content' ) ) { /** * Display the post content with a link to the single post * * @since 1.0.0 */ function basepress_post_single_content() { /** * Functions hooked in to basepress_post_content_before action. * * @hooked basepress_post_thumbnail - 10 */ do_action( 'basepress_post_single_content_before'); the_content( sprintf( /* translators: %s: Name of current post. */ wp_kses( __( 'Continue Reading %s ', 'basepress' ), array( 'span' => array( 'class' => array() ) ) ), the_title( '"', '"', false ) ) ); do_action( 'basepress_post_single_content_after' ); wp_link_pages( array( 'before' => '', ) ); } } if ( ! function_exists( 'basepress_post_header_meta' ) ) { function basepress_post_header_meta() { basepress_post_metadata(); } } if ( ! function_exists( 'basepress_post_content_wrapper' ) ) { function basepress_post_content_wrapper() { echo '
'; } } if ( ! function_exists( 'basepress_post_content_wrapper_close' ) ) { function basepress_post_content_wrapper_close() { echo '
'; } } if ( ! function_exists( 'basepress_post_tags' ) ) : /** * Displays the post tags on single post view */ function basepress_post_tags() { $metadata = array_flip( apply_filters('basepress_enable_post_metadata', array('tag') ) ); // Get tags. $tag_list = get_the_tag_list( '', __(', ', 'basepress') ); // Display tags. if ( $metadata ) : if ( isset( $metadata['tag'] ) ) : ?>
', 'basepress') . wp_kses_post($tag_list); ?>
', 'basepress') . wp_kses_post($tag_list); ?>
'%title', 'prev_text' => '%title', ); $enable_postnav = apply_filters('basepress_enable_postnav', true); if ( $enable_postnav ) { the_post_navigation( $args ); } } } if ( ! function_exists( 'basepress_display_comments' ) ) { /** * base display comments * * @since 1.0.0 */ function basepress_display_comments() { // If comments are open or we have at least one comment, load up the comment template. if ( comments_open() || '0' != get_comments_number() ) : comments_template(); endif; } } if ( ! function_exists( 'basepress_post_thumbnail' ) ) { /** * Display post thumbnail * * @var $size thumbnail size. thumbnail|medium|large|full|$custom * @uses has_post_thumbnail() * @uses the_post_thumbnail * @param string $size the post thumbnail size. * @since 1.0.0 */ function basepress_post_thumbnail( $size = 'large' ) { $featured_image_url = wp_get_attachment_url( get_post_thumbnail_id( get_the_ID() ) ); if ( ! empty( $featured_image_url ) ) { ?>
'ids', 'hide_empty' => 1, // We only need to know if there is more than one category. 'number' => 2, ) ); // Count the number of categories that are attached to the posts. $all_the_cool_cats = count( $all_the_cool_cats ); set_transient( 'basepress_categories', $all_the_cool_cats ); } if ( $all_the_cool_cats > 1 ) { // This blog has more than 1 category so basepress_categorized_blog should return true. return true; } else { // This blog has only 1 category so basepress_categorized_blog should return false. return false; } } } /** * Flush out the transients used in basepress_categorized_blog. */ function basepress_category_transient_flusher() { if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } // Like, beat it. Dig? delete_transient( 'basepress_categories' ); } add_action( 'edit_category', 'basepress_category_transient_flusher' ); add_action( 'save_post', 'basepress_category_transient_flusher' ); if ( ! function_exists ( 'basepress_post_metadata' ) ) : /** * Render post metat data * * @since 1.0.0 */ function basepress_post_metadata() { /** * Prefix all post meta * * @var array */ $prefix = apply_filters('basepress_prefix_post_metadata', array( 'date' => '', 'author' => __('By ', 'basepress'), 'category' => '', 'comment' => '', 'tag' => '', )); $postmeta = ''; /** * Allow theme author enable or disable post meta data * * @var [type] */ $metadata = apply_filters('basepress_enable_post_metadata', array( 'date', 'author', 'category', 'tag', 'comment' )); foreach ( $metadata as $md ) { switch ( $md ) { case 'date': $postmeta .= basepress_meta_date( $prefix[$md] ); break; case 'author': $postmeta .= basepress_meta_author( $prefix[$md] ); break; case 'category': $postmeta .= basepress_meta_category( $prefix[$md] ); break; case 'tag': $postmeta .= basepress_meta_tag( $prefix[$md] ); break; case 'comment': $postmeta .= basepress_meta_comments( $prefix[$md] ); break; } } if ( $postmeta ) { ?>
"', '"', false ) ), '', '' ); ?>
'. $prefix . '' : ''; if ( $modified ) { $time_string = sprintf( '', esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); } else { $time_string = sprintf( '', esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ) ); } return '' . $prefix . $time_string . ''; } endif; if ( ! function_exists( 'basepress_meta_author' ) ) : /** * Displays the post author */ function basepress_meta_author( $prefix = '' ) { $prefix = $prefix != '' ? ''. $prefix . '' : ''; $author_string = sprintf( '', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( esc_html__( 'View all posts by %s', 'basepress' ), get_the_author() ) ), esc_html( get_the_author() ) ); return '' . $prefix . wp_kses_post($author_string) . ''; } endif; if ( ! function_exists( 'basepress_meta_category' ) ) : /** * Displays the category of posts */ function basepress_meta_category( $prefix = '' ) { $prefix = $prefix != '' ? ''. $prefix . '' : ''; $categories_list = get_the_category_list( ', ' ); if ( $categories_list ) { return ' ' . $prefix . wp_kses_post($categories_list) . ''; } } endif; if ( ! function_exists( 'basepress_meta_tag' ) ) : /** * Displays the category of posts */ function basepress_meta_tag( $prefix = '' ) { $prefix = $prefix != '' ? ''. $prefix . '' : ''; $tags_list = get_the_tag_list( '', __( ', ', 'basepress' ) ); if ( $tags_list && ! is_single() ) { return ' ' . $prefix . wp_kses_post( $tags_list ) . ''; } } endif; if ( ! function_exists( 'basepress_meta_comments' ) ) : /** * Displays the comment of posts */ function basepress_meta_comments( $prefix = '' ) { $prefix = $prefix != '' ? ''. $prefix . '' : ''; if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { $txt_comment = ''.get_comments_number_text( __('Leave a Comment', 'basepress'), __('One Comment', 'basepress'), __('% Comments', 'basepress')) . ''; return '' . $prefix . $txt_comment . ''; } } endif; if ( ! function_exists( 'basepress_meta_edit_link' ) ) : /** * Displays the category of posts */ function basepress_meta_edit_link() { return ' ' . get_the_category_list( ', ' ) . ''; } endif; if ( ! function_exists( 'basepress_get_sidebar' ) ) { /** * Display base sidebar * * @uses get_sidebar() * @since 1.0.0 */ function basepress_get_sidebar() { get_sidebar(); } } if ( ! function_exists( 'basepress_header_widget_region' ) ) { /** * Display header widget region * * @since 1.0.0 */ function basepress_header_widget_region() { if ( is_active_sidebar( 'header-1' ) ) { ?> 0 && ( is_active_sidebar( 'footer-1' ) || is_active_sidebar( 'footer-2' ) || is_active_sidebar( 'footer-3' ) || is_active_sidebar( 'footer-4' ) ) ) : ?>
'; } } if ( ! function_exists( 'basepress_credit_wrapper_close' )) { /** * Credit close wrapper */ function basepress_credit_wrapper_close() { echo '
'; } } if ( ! function_exists( 'basepress_footer_nav' ) ) { /** * Display footer menu * * @since 1.0.0 * @return void */ function basepress_footer_nav() { // Check if there is a footer menu. if ( has_nav_menu( 'footer' ) ) { echo ''; } } } if ( ! function_exists( 'basepress_credit' ) ) { /** * Display the theme credit * * @since 1.0.0 * @return void */ function basepress_credit() { ?>
ThemeCountry Powered by WordPress', 'basepress' ), 'https://basepresspro.com' )); ?>
', '' ); ?>
'', ) ); ?>
'webpage', '@id' => get_the_permalink(), ); $json['publisher'] = array( '@type' => 'organization', 'name' => get_bloginfo( 'name' ), 'logo' => array( '@type' => 'ImageObject', 'url' => $logo[0], 'width' => $logo[1], 'height' => $logo[2], ), ); $json['author'] = array( '@type' => 'person', 'name' => get_the_author(), ); if ( $image ) { $json['image'] = array( '@type' => 'ImageObject', 'url' => $image[0], 'width' => $image[1], 'height' => $image[2], ); } $json['datePublished'] = get_post_time( 'c' ); $json['dateModified'] = get_the_modified_date( 'c' ); $json['name'] = get_the_title(); $json['headline'] = $json['name']; $json['description'] = get_the_excerpt(); // Page's structured data. } elseif ( is_page() ) { $json['@type'] = 'WebPage'; $json['url'] = get_the_permalink(); $json['name'] = get_the_title(); $json['description'] = get_the_excerpt(); } if ( isset( $json ) ) { BasePress::set_structured_data( apply_filters( 'basepress_structured_data', $json ) ); } } } if ( ! function_exists( 'basepress_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. */ function basepress_posted_on() { $meta_items = apply_filters('basepress_posted_metadata', array( 'meta-date' => true, 'meta-au' => true, )); $time_string = ''; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = ''; //$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', 'basepress' ), '' . $time_string . '' ); $byline = sprintf( esc_html_x( 'by %s', 'post author', 'basepress' ), '' . esc_html( get_the_author() ) . '' ); if ( isset( $meta_items['meta-date'] ) ) { echo '' . $posted_on . ''; } if ( isset( $meta_items['meta-au'] ) ) { echo '' . $byline . ''; } } endif; if ( ! function_exists( 'basepress_entry_footer' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. */ function basepress_entry_footer() { $meta_items = apply_filters('basepress_posted_metadata_footer', array( 'meta-cat' => true, 'meta-com' => true, )); // Hide category and tag text for pages. if ( 'post' === get_post_type() ) { if ( isset( $meta_items['meta-cat'] ) ) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( esc_html__( ', ', 'basepress' ) ); if ( $categories_list && basepress_categorized_blog() ) { printf( '' . esc_html__( '%1$s', 'basepress' ) . '', $categories_list ); // WPCS: XSS OK. } } } if ( isset( $meta_items['meta-com'] ) ) { if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ''; /* translators: %s: post title */ comments_popup_link( sprintf( wp_kses( __( 'Leave a Comment on %s', 'basepress' ), array( 'span' => array( 'class' => array() ) ) ), get_the_title() ) ); echo ''; } } edit_post_link( sprintf( /* translators: %s: Name of current post */ esc_html__( 'Edit %s', 'basepress' ), the_title( '"', '"', false ) ), '', '' ); } endif;