0 ) {
$length = absint( $excerpt_length );
}
return $length;
}
endif;
add_filter( 'excerpt_length', 'best_learner_excerpt_length', 999 );
if( ! function_exists( 'best_learner_banner_header
' ) ) :
/**
* Page Header
*/
function best_learner_banner_header() {
if ( is_front_page() && is_home() ){
$header_image = get_header_image();
$header_image_url = ! empty( $header_image ) ? $header_image : get_template_directory_uri() . '/assets/images/default-header.jpg';
}
elseif( is_front_page() ) {
return;
}
else {
$header_image_url = best_learner_banner_image( $image_url = '' );
} ?>
';
}
endif;
add_action( 'best_learner_banner_header', 'best_learner_banner_header', 10 );
if( ! function_exists( 'best_learner_banner_title' ) ) :
/**
* Page Header
*/
function best_learner_banner_title(){
if ( ( is_front_page() && is_home() ) || is_home() ){
echo '';
esc_html_e( 'Blog','best-learner' );
echo '
';
}
if( is_singular() ) {
the_title( '', '
' );
}
if( is_archive() ){
the_archive_description( '', '
' );
the_archive_title( '', '
' );
}
if( is_search() ){ ?>
' . get_search_query() . '' ); ?>
' . esc_html__( 'Error 404', 'best-learner' ) . '';
}
}
endif;
if( ! function_exists( 'best_learner_banner_image' ) ) :
/**
* Banner Header Image
*/
function best_learner_banner_image( $image_url ){
global $post;
$archive_header = best_learner_get_option( 'archive_header_image' );
$search_header = best_learner_get_option( 'search_header_image' );
$header_404 = best_learner_get_option( '404_header_image' );
if ( is_home() && ! is_front_page() ){
$image_url = get_the_post_thumbnail_url( get_option( 'page_for_posts' ), 'full' );
$header_image = get_header_image();
$fallback_image = ! empty( $header_image ) ? $header_image : get_template_directory_uri() . '/assets/images/default-header.jpg';
$image_url = ( ! empty( $image_url) ) ? $image_url : $fallback_image;
}
elseif( is_singular() ){
$image_url = get_the_post_thumbnail_url( $post->ID, 'full' );
$header_image = get_header_image();
$fallback_image = ! empty( $header_image ) ? $header_image : get_template_directory_uri() . '/assets/images/default-header.jpg';
$image_url = ( ! empty( $image_url) ) ? $image_url : $fallback_image;
}
elseif( is_archive() ){
$image_url = ( ! empty( $archive_header) ) ? $archive_header : get_template_directory_uri() . '/assets/images/default-header.jpg';
}
elseif( is_search() ){
$image_url = ( ! empty( $search_header) ) ? $search_header : get_template_directory_uri() . '/assets/images/default-header.jpg';
}
elseif( is_404() ) {
$image_url = ( ! empty( $header_404) ) ? $header_404 : get_template_directory_uri() . '/assets/images/default-header.jpg';
}
return $image_url;
}
endif;
if ( ! function_exists( 'best_learner_posts_tags' ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function best_learner_posts_tags() {
// Hide category and tag text for pages.
if ( 'post' === get_post_type() && has_tag() ) { ?>
';
echo '';
if ( ! empty( $social_link1 ) ) {
echo ' ';
}
if ( ! empty( $social_link2 ) ) {
echo ' ';
}
if ( ! empty( $social_link3 ) ) {
echo ' ';
}
echo '
';
echo '';
}