]+>(.*?)<\/a>%i', '$1', $logo ); $logo = str_replace( 'custom-logo', 'custom-logo custom-logo-' . $logo_pos, $logo ); echo $logo; } } endif; /** * add actions for logo show * */ $logo_pos = get_theme_mod( 'display_logo_and_title' ); if ( 'image' == $logo_pos ) { add_action( 'basic_before_blogname_in_logo', 'basic_custom_logo_open_hideclass', 20 ); add_action( 'basic_after_blogname_in_logo', 'basic_custom_logo_close_hideclass', 20 ); } if ( 'bottom' == $logo_pos ) { add_action( 'basic_after_blogname_in_logo', 'basic_the_custom_logo' ); } else { add_action( 'basic_before_blogname_in_logo', 'basic_the_custom_logo' ); } /** * hide sitetitle * */ function basic_custom_logo_open_hideclass() { ob_start(); } function basic_custom_logo_close_hideclass() { ob_clean(); } /** * echo post meta information * filter `basic_post_meta_list` accept values: 'date', 'category', 'comments', 'author' * * @since 1.1.6 */ if ( ! function_exists( 'basic_get_postmeta' ) ): function basic_get_postmeta() { $default_meta_list = get_theme_mod( 'postmeta_list', apply_filters( 'basic_postmeta_list_defaults', array( 'date', 'category', 'comments' ) ) ); $default_meta_list = ! is_array( $default_meta_list ) ? explode( '_', $default_meta_list ) : $default_meta_list; $meta_list = apply_filters( 'basic_post_meta_list', $default_meta_list ); $displayed_meta_list = $meta_list; if ( is_customize_preview() ) { $all = array_merge( $meta_list, array( 'date', 'category', 'comments', 'tags', 'author' ) ); $meta_list = array_unique( $all ); } if ( empty( $meta_list ) ) { return; } $meta_html = array(); foreach ( $meta_list as $meta ) { $preview = ( ! in_array( $meta, $displayed_meta_list ) ) ? ' hide' : ''; switch ( $meta ) { case 'date': $meta_html[ $meta ] = '' . get_the_time( get_option( 'date_format' ) ) . ''; break; case 'author': $meta_html[ $meta ] = '' . get_the_author() . ''; break; case 'category': $meta_html[ $meta ] = '' . get_the_category_list( ', ' ) . ''; break; case 'comments': $meta_html[ $meta ] = '' . __( 'Comments', 'basic' ) . ': ' . get_comments_number() . ''; break; case 'tags': $meta_html[ $meta ] = '' . get_the_tag_list( __( 'Tags: ', 'basic' ), ', ' ) . ''; break; } } $meta_html = apply_filters( 'basic_post_meta_list_html', $meta_html ); $html = ''; foreach ( $meta_list as $meta ) { $html .= ( array_key_exists($meta,$meta_html) ) ? $meta_html[ $meta ] : ''; } $html = apply_filters( 'basic_post_meta_html', $html ); echo ''; } endif; add_action( 'basic_after_post_title', 'basic_get_postmeta', 10 );