ID; if( alhenalite_is_woocommerce_active('is_shop') ) { $content_ID = get_option('woocommerce_shop_page_id'); } $val = get_post_meta( $content_ID , $id, TRUE); if(isset($val)) { return $val; } else { return ''; } } } /*-----------------------------------------------------------------------------------*/ /* Woocommerce is active */ /*-----------------------------------------------------------------------------------*/ if ( ! function_exists( 'alhenalite_is_woocommerce_active' ) ) { function alhenalite_is_woocommerce_active( $type = "" ) { global $woocommerce; if ( isset( $woocommerce ) ) { if ( !$type || call_user_func($type) ) { return true; } } } } /*-----------------------------------------------------------------------------------*/ /* GET ARCHIVE TITLE */ /*-----------------------------------------------------------------------------------*/ if (!function_exists('alhenalite_get_archive_title')) { function alhenalite_get_archive_title() { if ( is_category() ) { $title = sprintf( esc_html__( 'Category: %s', 'alhena-lite' ), single_cat_title( '', false ) ); } elseif ( is_tag() ) { $title = sprintf( esc_html__( 'Tag: %s', 'alhena-lite' ), single_tag_title( '', false ) ); } elseif ( is_author() ) { $title = sprintf( esc_html__( 'Author: %s', 'alhena-lite' ), '' . get_the_author() . '' ); } elseif ( is_year() ) { $title = sprintf( esc_html__( 'Year: %s', 'alhena-lite' ), get_the_date( esc_html_x( 'Y', 'yearly archives date format', 'alhena-lite' ) ) ); } elseif ( is_month() ) { $title = sprintf( esc_html__( 'Month: %s', 'alhena-lite' ), get_the_date( esc_html_x( 'F Y', 'monthly archives date format', 'alhena-lite' ) ) ); } elseif ( is_day() ) { $title = sprintf( esc_html__( 'Day: %s', 'alhena-lite' ), get_the_date( esc_html_x( 'F j, Y', 'daily archives date format', 'alhena-lite' ) ) ); } elseif ( is_tax( 'post_format' ) ) { if ( is_tax( 'post_format', 'post-format-aside' ) ) { $title = esc_html_x( 'Asides', 'post format archive title', 'alhena-lite' ); } elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) { $title = esc_html_x( 'Galleries', 'post format archive title', 'alhena-lite' ); } elseif ( is_tax( 'post_format', 'post-format-image' ) ) { $title = esc_html_x( 'Images', 'post format archive title', 'alhena-lite' ); } elseif ( is_tax( 'post_format', 'post-format-video' ) ) { $title = esc_html_x( 'Videos', 'post format archive title', 'alhena-lite' ); } elseif ( is_tax( 'post_format', 'post-format-quote' ) ) { $title = esc_html_x( 'Quotes', 'post format archive title', 'alhena-lite' ); } elseif ( is_tax( 'post_format', 'post-format-link' ) ) { $title = esc_html_x( 'Links', 'post format archive title', 'alhena-lite' ); } elseif ( is_tax( 'post_format', 'post-format-status' ) ) { $title = esc_html_x( 'Statuses', 'post format archive title', 'alhena-lite' ); } elseif ( is_tax( 'post_format', 'post-format-audio' ) ) { $title = esc_html_x( 'Audio', 'post format archive title', 'alhena-lite' ); } elseif ( is_tax( 'post_format', 'post-format-chat' ) ) { $title = esc_html_x( 'Chats', 'post format archive title', 'alhena-lite' ); } } elseif ( is_post_type_archive() ) { $title = sprintf( esc_html__( 'Archives: %s', 'alhena-lite' ), post_type_archive_title( '', false ) ); } elseif ( is_tax() ) { $tax = get_taxonomy( get_queried_object()->taxonomy ); $title = sprintf( esc_html__( '%1$s: %2$s', 'alhena-lite' ), $tax->labels->singular_name, single_term_title( '', false ) ); } if ( isset($title) ) : return $title; else: return false; endif; } } /*-----------------------------------------------------------------------------------*/ /* IS SINGLE */ /*-----------------------------------------------------------------------------------*/ if (!function_exists('alhenalite_is_single')) { function alhenalite_is_single() { if ( is_single() || is_page() ) : return true; endif; } } /*-----------------------------------------------------------------------------------*/ /* REQUIRE */ /*-----------------------------------------------------------------------------------*/ if (!function_exists('alhenalite_require')) { function alhenalite_require($folder) { if (isset($folder)) : $dir = get_template_directory() . $folder ; $files = scandir($dir); foreach ($files as $key => $value) { if ( !in_array($value,array(".DS_Store",".","..") ) && !strstr( $value, '._' ) ) { if ( !is_dir( $dir . $value) ) { require_once $dir . $value; } } } endif; } } /*-----------------------------------------------------------------------------------*/ /* SCRIPTS */ /*-----------------------------------------------------------------------------------*/ if (!function_exists('alhenalite_enqueue_script')) { function alhenalite_enqueue_script($folder) { if ( isset($folder) ) : $dir = get_template_directory() . $folder ; $files = scandir($dir); foreach ($files as $key => $value) { if ( !in_array($value,array(".DS_Store",".","..") ) && !strstr( $value, '._' ) ) { if ( !is_dir( $dir . $value ) && strstr ( $value, 'js' )) { wp_enqueue_script( str_replace('.js','',$value), get_template_directory_uri() . $folder . "/" . $value , array('jquery'), FALSE, TRUE ); } } } endif; } } /*-----------------------------------------------------------------------------------*/ /* STYLES */ /*-----------------------------------------------------------------------------------*/ if (!function_exists('alhenalite_enqueue_style')) { function alhenalite_enqueue_style($folder) { if (isset($folder)) : $dir = get_template_directory() . $folder ; $files = scandir($dir); foreach ($files as $key => $value) { if ( !in_array($value,array(".DS_Store",".","..") ) && !strstr( $value, '._' ) ) { if ( !is_dir( $dir . $value ) && strstr ( $value, 'css' )) { wp_enqueue_style( str_replace('.css','',$value), get_template_directory_uri() . $folder . "/" . $value ); } } } endif; } } /*-----------------------------------------------------------------------------------*/ /* TAG TITLE */ /*-----------------------------------------------------------------------------------*/ if ( ! function_exists( '_wp_render_title_tag' ) ) { function alhenalite_title( $title, $sep ) { global $paged, $page; if ( is_feed() ) return $title; $title .= get_bloginfo( 'name' ); $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title = "$title $sep $site_description"; if ( $paged >= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( esc_html__( 'Page %s', "alhena-lite" ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'alhenalite_title', 10, 2 ); function alhenalite_addtitle() { ?>