0 ) {
$length = absint( $excerpt_length );
}
return $length;
}
endif;
add_filter( 'excerpt_length', 'akisa_excerpt_length', 999 );
if( ! function_exists( 'akisa_banner_header
' ) ) :
/**
* Page Header
*/
function akisa_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 = akisa_banner_image( $image_url = '' );
} ?>
';
}
endif;
add_action( 'akisa_banner_header', 'akisa_banner_header', 10 );
if( ! function_exists( 'akisa_banner_title' ) ) :
/**
* Page Header
*/
function akisa_banner_title(){
$latest_posts_title = akisa_get_option( 'latest_posts_title' );
$single_post_title = akisa_get_option( 'single_post_header_title_enable' );
$single_page_title = akisa_get_option( 'single_page_header_title_enable' );
$blog_post_title_enable = akisa_get_option( 'blog_post_header_title_enable' );
$archive_post_title = akisa_get_option( 'archive_post_header_title_enable' );
if ( (( is_front_page() && is_home() ) || is_home() ) && !empty($latest_posts_title && $blog_post_title_enable==true) ){ ?>
', '' );
}
if( is_page() && $single_page_title==true) {
the_title( '', '
' );
}
if( is_archive() && $archive_post_title==true ){
the_archive_description( '', '
' );
the_archive_title( '', '
' );
}
if( is_search() ){ ?>
' . get_search_query() . '' ); ?>
' . esc_html__( 'Error 404', 'akisa' ) . '';
}
}
endif;
if( ! function_exists( 'akisa_banner_image' ) ) :
/**
* Banner Header Image
*/
function akisa_banner_image( $image_url ){
global $post;
$archive_header = akisa_get_option( 'archive_header_image' );
$search_header = akisa_get_option( 'search_header_image' );
$header_404 = akisa_get_option( '404_header_image' );
$post_header_image_condition = akisa_get_option( 'single_post_header_image_as_header_image_enable' );
$page_header_image_condition = akisa_get_option( 'single_page_header_image_as_header_image_enable' );
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_single() ){
$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) && $post_header_image_condition==false ) ? $image_url : $fallback_image;
}
elseif( is_page() ){
$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) && $page_header_image_condition==false ) ? $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( 'akisa_posts_tags' ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function akisa_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 '';
}
if ( ! function_exists( 'akisa_pagination' ) ) :
/**
* blog/archive pagination.
*
* @return pagination type value
*/
function akisa_pagination() {
$pagination = akisa_get_option( 'pagination_type' );
if ( $pagination == 'default' ) :
the_posts_navigation();
elseif ( $pagination == 'numeric' ) :
the_posts_pagination( array(
'mid_size' => 4,
// 'prev_text' => ,
// 'next_text' => ,
) );
endif;
}
endif;
add_action( 'akisa_pagination_action', 'akisa_pagination', 10 );