'; echo $video_html; echo ''; } else: do_action('be_page_posts_formats_thumbnail'); endif; } endif; add_action( 'be_page_posts_formats_video', 'be_page_posts_formats_video' ); if ( ! function_exists( 'be_page_posts_formats_audio' ) ) : /** * Post Formats audio. * * @since 1.0.0 */ function be_page_posts_formats_audio() { $content = apply_filters( 'the_content', get_the_content() ); $audio = false; // Only get audio from the content if a playlist isn't present. if ( false === strpos( $content, 'wp-playlist-script' ) ) { $audio = get_media_embedded_in_content( $content, array( 'audio' ) ); } $post_thumbnail_url = ''; if ( has_post_thumbnail() ) : $post_thumbnail_id = get_post_thumbnail_id( get_the_ID() ); $post_thumbnail_url = wp_get_attachment_url( $post_thumbnail_id ); endif; // If not a single post, highlight the audio file. if ( ! empty( $audio ) ) : foreach ( $audio as $audio_html ) { echo '
'; echo $audio_html; echo '
'; } else: do_action('be_page_posts_formats_video'); endif; } endif; add_action( 'be_page_posts_formats_audio', 'be_page_posts_formats_audio' ); add_filter( 'use_default_gallery_style', '__return_false' ); if ( ! function_exists( 'be_page_posts_formats_gallery' ) ) : /** * Post Formats gallery. * * @since 1.0.0 */ function be_page_posts_formats_gallery() { global $post; $post_thumbnail_url = ''; if ( has_post_thumbnail() ) : $post_thumbnail_id = get_post_thumbnail_id( get_the_ID() ); $post_thumbnail_url = wp_get_attachment_url( $post_thumbnail_id ); endif; if ( get_post_gallery() ) : echo ''; else: do_action('be_page_posts_formats_thumbnail'); endif; } endif; add_action( 'be_page_posts_formats_gallery', 'be_page_posts_formats_gallery' ); if ( ! function_exists( 'be_page_posts_blog_media' ) ) : /** * Post be_page_posts_blog_media * * @since 1.0.0 */ function be_page_posts_blog_media() { $formats = get_post_format(get_the_ID()); switch ( $formats ) { default: do_action('be_page_posts_formats_thumbnail'); break; case 'gallery': do_action('be_page_posts_formats_gallery'); break; case 'audio': do_action('be_page_posts_formats_audio'); break; case 'video': do_action('be_page_posts_formats_video'); break; } } endif; add_action( 'be_page_posts_blog_media', 'be_page_posts_blog_media' ); if ( ! function_exists( 'be_page_short_excerpt' ) ) : /** * Filter the except length to 20 words. * * @param int $length Excerpt length. * @return int (Maybe) modified excerpt length. */ function be_page_short_excerpt( $length ){ if ( is_admin() ) { return $length; } return absint( get_theme_mod( 'excerpt_length', 160 ) ); } add_filter( 'excerpt_length', 'be_page_short_excerpt', 999 ); endif; if ( ! function_exists( 'be_page_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time. */ function be_page_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() ) ); $posted_on = sprintf( /* translators: %s: post date. */ esc_html_x( 'Posted on %s', 'post date', 'be-page' ), '' . $time_string . '' ); echo '
'; echo '' . $posted_on . ''; // WPCS: XSS OK. /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( esc_html__( ', ', 'be-page' ) ); if ( $categories_list ) { /* translators: 1: list of categories. */ printf( '' . esc_html__( 'in %1$s', 'be-page' ) . '', $categories_list ); // WPCS: XSS OK. } if( get_theme_mod( 'blog_content_type', 'excerpt' ) == 'content' ) : printf( ' %1$s %3$s', esc_html__( 'by ', 'be-page' ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_html( get_the_author() ) ); endif; echo '
'; } endif; if ( ! function_exists( 'be_page_posted_author' ) ) : /** * Prints author link for excerpt type content. */ function be_page_posted_author() { printf( '
%2$s
', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), get_avatar( get_the_author_meta('user_email'), $size = '40') . esc_html__( 'by ', 'be-page' ). esc_html( get_the_author() ) ); } endif; if ( ! function_exists( 'be_page_single_posts_get_author' ) ) : /** * Prints author link for single page content. */ function be_page_single_posts_get_author( $post_id = 0 ){ $post = get_post( $post_id ); if( $post->post_author != "" ){ printf( '
%2$s
', esc_url( get_author_posts_url( get_the_author_meta( 'ID', $post->post_author ) ) ), get_avatar( get_the_author_meta( 'user_email', $post->post_author ), $size = '40') . esc_html__( 'by ', 'be-page' ). get_the_author_meta( 'display_name', $post->post_author ) ); } } endif; if ( ! function_exists( 'be_page_walker_comment' ) ) : /** * Implement Custom Comment template. * * @since 1.0.0 * * @param $comment, $args, $depth * @return $html */ function be_page_walker_comment($comment, $args, $depth) { ?>
  • $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>

  • %s', 'be-page' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ), '', '' ); } endif;