%PDF- %PDF-
Direktori : /var/www/html/shaban/laviva/wp-content/themes/levelup/inc/helpers/ |
Current File : /var/www/html/shaban/laviva/wp-content/themes/levelup/inc/helpers/page.php |
<?php // File Security Check if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! function_exists( 'levelup_get_page_title' ) ) { function levelup_get_page_title() { global $levelup_options; $title = ''; if ( is_page() || is_single() ) { $title = get_the_title(); } else if ( is_search() ) { $page_title = _x( 'Search Results for', 'archive template title', 'LEVELUP' ); $title = sprintf( '<span class="page-t-title">%s</span> <span>%s</span>', $page_title, get_search_query() ); } else if ( is_archive() ) { if ( is_category() ) { $page_title = _x( 'Category', 'archive template title', 'LEVELUP' ); $title = sprintf( '<span class="page-t-title">%s</span> <span>%s</span>', $page_title, single_cat_title( '', false ) ); } elseif ( is_tag() ) { $page_title = _x( 'Tag', 'archive template title', 'LEVELUP' ); $title = sprintf( '<span class="page-t-title">%s</span> <span>%s</span>', $page_title, single_tag_title( '', false ) ); } elseif ( is_author() ) { the_post(); $page_title = _x( 'Author', 'archive template title', 'LEVELUP' ); $title = sprintf( '<span class="page-t-title">%s</span> %s', $page_title, get_the_author() ); rewind_posts(); } elseif ( is_day() ) { $page_title = _x( 'Daily Archives', 'archive template title', 'LEVELUP' ); $title = sprintf( '<span class="page-t-title">%s</span> <span>%s</span>', $page_title, get_the_date() ); } elseif ( is_month() ) { $page_title = _x( 'Monthly Archives', 'archive template title', 'LEVELUP' ); $title = sprintf( '<span class="page-t-title">%s</span> <span>%s</span>', $page_title, get_the_date( 'F Y' ) ); } elseif ( is_year() ) { $page_title = _x( 'Yearly Archives', 'archive template title', 'LEVELUP' ); $title = sprintf( '<span class="page-t-title">%s</span> <span>%s</span>', $page_title, get_the_date( 'Y' ) ); } elseif ( is_tax('rdy_portfolio_category') ) { $page_title = _x( 'Portfolio', 'archive template title', 'LEVELUP' ); $title = sprintf( '<span class="page-t-title">%s</span> <span>%s</span>', $page_title, single_term_title( '', false ) ); } elseif ( class_exists( 'Woocommerce' ) && is_shop() ) { $page_title = _x( 'Shop', 'archive template title', 'LEVELUP' ); $title = sprintf( '%s <span>%s</span>', $page_title, single_term_title( '', false ) ); } elseif ( class_exists( 'Woocommerce' ) && is_product_category() ) { $title = '<span>' . single_term_title( '', false ) . '</span>'; } else { $title = _x( 'Archives', 'archive template title', 'LEVELUP' ); } } elseif ( is_404() ) { $title = _x( 'Page not found', 'index title', 'LEVELUP' ); } else { $title = $levelup_options['blog_header_text_title'] ? $levelup_options['blog_header_text_title'] : _x( 'Blog', 'index title', 'LEVELUP' ); } return apply_filters( 'levelup_get_page_title', $title ); } } if ( ! function_exists( 'levelup_get_page_title_html_class' ) ) { function levelup_get_page_title_html_class( $class = array() ) { global $levelup_options; $config = Levelup_Config::get_instance(); $output = array(); if ( is_single() ) { $output[] = 'entry-title'; } $title_fontsize = levelup_sanitize_px($levelup_options['page_title_font']['font-size']); if ($title_fontsize) { $output[] = levelup_calculate_responsive_font_class($title_fontsize); } if ( $class && ! is_array( $class ) ) { $class = explode( ' ', $class ); } $output = apply_filters( 'levelup_get_page_title_html_class', array_merge( $class, $output ) ); return $output ? sprintf( 'class="%s"', levelup_esc_implode( ' ', array_unique( $output ) ) ) : ''; } } if ( ! function_exists( 'levelup_get_page_title_wrap_html_class' ) ) { function levelup_get_page_title_wrap_html_class( $class = array() ) { $config = Levelup_Config::get_instance(); $output = array(); switch( $config->get( 'page_title.align' ) ) { case 'right' : $output[] = 'title-right'; break; case 'left' : $output[] = 'title-left'; break; case 'all_right' : $output[] = 'content-right'; break; case 'all_left' : $output[] = 'content-left'; break; default: $output[] = 'title-center'; } $title_bg_mode_class = levelup_get_page_title_bg_mode_html_class(); if ( $title_bg_mode_class ) { $output[] = $title_bg_mode_class; } $output[] = 'page-title-topfix'; if ( $class && ! is_array( $class ) ) { $class = explode( ' ', $class ); } $output = apply_filters( 'levelup_get_page_title_wrap_html_class', array_merge( $class, $output ) ); return $output ? sprintf( 'class="%s"', levelup_esc_implode( ' ', array_unique( $output ) ) ) : ''; } } if ( ! function_exists( 'levelup_get_page_title_bg_mode_html_class' ) ) { function levelup_get_page_title_bg_mode_html_class() { $class = 'solid-bg'; return $class; } }