', esc_url( get_bloginfo( 'pingback_url' ) ) ); } } } add_action( 'wp_head', 'beetan_pingback_header' ); if ( ! function_exists( 'beetan_custom_excerpt_more' ) ) { /** * Add Custom Excerpt with Read more. */ function beetan_custom_excerpt_more( $more ) { if ( ! is_admin() ) { $more = esc_html__( '...', 'beetan' ); } return $more; } } add_filter( 'excerpt_more', 'beetan_custom_excerpt_more' ); if ( ! function_exists( 'beetan_excerpt_length' ) ) { /** * Filter the excerpt length */ function beetan_excerpt_length( $length ) { if ( is_admin() ) { return $length; } $length = get_theme_mod( 'blog_excerpt_length', 30 ); return $length; } } add_filter( 'excerpt_length', 'beetan_excerpt_length' ); if ( ! function_exists( 'beetan_skip_links' ) ) { /** * Display Skip links */ function beetan_skip_links() { printf( '', esc_html__( 'Skip to content', 'beetan' ) ); } } if ( ! function_exists( 'beetan_post_password_form' ) ) { /** * Retrieve protected post password form content. * * @param $output * @param int $post * * @return string HTML content for password form for password protected post. */ function beetan_post_password_form( $output, $post = 0 ) { $post = get_post( $post ); $label = 'pwbox-' . ( empty( $post->ID ) ? rand() : $post->ID ); $output = '

' . esc_html__( 'This content is password protected. Please enter a password to view.', 'beetan' ) . '

'; return $output; } } add_filter( 'the_password_form', 'beetan_post_password_form', 10, 2 ); if ( ! function_exists( 'beetan_check_title_hide' ) ) { /** * Post/Page title hide/show */ function beetan_check_title_hide( $value ) { global $post; if ( is_page() && ( get_theme_mod( 'hide_page_title', false ) === true ) ) { $value = false; } if ( is_single() && ( get_theme_mod( 'hide_single_post_title', false ) === true ) ) { $value = false; } if ( '1' === get_post_meta( $post->ID, 'beetan_hide_title', true ) ) { $value = false; } return $value; } } add_filter( 'beetan_page_title_visibility', 'beetan_check_title_hide' ); add_filter( 'beetan_post_title_visibility', 'beetan_check_title_hide' ); if ( ! function_exists( 'beetan_container_layout' ) ) { /** * Site Container Layout */ function beetan_container_layout() { $post_type = get_post_type(); $container = 'box'; if ( is_singular() ) { if ( in_array( $post_type, array( 'post', 'page', 'product' ) ) ) { $container = get_theme_mod( $post_type . '_container_layout' ); } } if ( is_archive() || is_search() || is_author() || is_category() || is_home() || is_tag() ) { $container = get_theme_mod( 'archive_post_container_layout', 'contained' ); } if ( ( beetan_is_woocommerce_active() && is_shop() ) || ( beetan_is_woocommerce_active() && is_product_taxonomy() ) ) { $container = get_theme_mod( 'archive_product_container_layout', 'contained' ); } // Customizer container layout if ( empty( $container ) ) { $container = get_theme_mod( 'default_container_layout' ); } // Default container layout Fallback if ( ! in_array( $container, array( 'box', 'contained', 'stretched' ), true ) ) { $container = get_theme_mod( 'default_container_layout', 'box' ); } if ( is_page_template( 'templates/template-fullwidth-container.php' ) ) { $container = 'contained'; } if ( is_page_template( 'templates/template-fullwidth.php' ) ) { $container = 'stretched'; } return apply_filters( 'beetan_container_layout', $container ); } } if ( ! function_exists( 'beetan_sidebar_layout' ) ) { /** * Site Sidebar Layout */ function beetan_sidebar_layout() { $post_type = get_post_type(); $sidebar_layout = ''; if ( is_singular() ) { if ( in_array( $post_type, array( 'post', 'page', 'product' ) ) ) { $sidebar_layout = get_theme_mod( $post_type . '_sidebar_position' ); } } elseif ( ( beetan_is_woocommerce_active() && is_shop() ) || ( beetan_is_woocommerce_active() && is_product_taxonomy() ) ) { $sidebar_layout = get_theme_mod( 'archive_product_sidebar_position' ); } else { $sidebar_layout = get_theme_mod( 'archive_post_sidebar_position', 'no_sidebar' ); } return apply_filters( 'beetan_sidebar_layout', $sidebar_layout ); } } if ( ! function_exists( 'beetan_get_template' ) ) { /* * Get Template with Template Argument */ function beetan_get_template( $template_name, $template_args = array(), $include_once = false ) { $path = apply_filters( 'beetan_theme_file_path', get_theme_file_path( $template_name ), $template_name ); do_action( 'beetan_before_get_template', $template_name, $template_args, $path ); extract( $template_args ); if ( $include_once ) { include_once $path; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } else { include $path; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } do_action( 'beetan_after_get_template', $template_name, $template_args, $path ); } } if ( ! function_exists( 'beetan_masonry_layout_data' ) ) { /** * Masonry layout data * * @param string $itemSelector * * @return mixed|void */ function beetan_masonry_layout_data( $itemSelector = 'article' ) { if ( get_theme_mod( 'blog_layout', 'default' ) !== 'masonry' ) { return; } $data = 'data-masonry=\'{ "itemSelector": "' . $itemSelector . '", "gutter": ' . esc_html( get_theme_mod( 'blog_posts_gap', 5 ) ) . ' }\''; return apply_filters( 'beetan_masonry_layout_data', wp_kses_post( $data ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } /** * Check is WooCommerce Activated * * @return bool */ function beetan_is_woocommerce_active() { if ( class_exists( 'WooCommerce' ) ) { return true; } return false; } /** * WooCommerce Sidebar disable pages * * @return bool */ function beetan_is_woocommerce_sidebar_disable() { if ( beetan_is_woocommerce_active() && ( is_checkout() || is_cart() || is_account_page() ) || ( 'stretched' == beetan_container_layout() ) ) { return true; } return false; } if ( ! function_exists( 'beetan_site_header' ) ) { /** * Display the site header */ function beetan_site_header() { get_template_part( 'template-parts/header/site-header' ); } } if ( ! function_exists( 'beetan_site_footer' ) ) { /** * Display the site footer */ function beetan_site_footer() { get_template_part( 'template-parts/footer/site-footer' ); } } if ( ! function_exists( 'beetan_footer_widgets' ) ) { /** * Display the footer widgets */ function beetan_footer_widgets() { get_template_part( 'template-parts/footer/footer-widgets' ); } } if ( ! function_exists( 'beetan_footer_copyright' ) ) { /** * Display the site footer credit */ function beetan_footer_copyright() { get_template_part( 'template-parts/footer/footer-copyright' ); } } if ( ! function_exists( 'beetan_offcanvas' ) ) { /** * Display the mobile offcanvas menu */ function beetan_offcanvas() { get_template_part( 'template-parts/footer/offcanvas' ); } } if ( ! function_exists( 'beetan_site_overlay' ) ) { /** * Display the site overlay */ function beetan_site_overlay() { echo '
'; } } if ( ! function_exists( 'beetan_search_popup' ) ) { /** * Display the search popup */ function beetan_search_popup() { get_template_part( 'template-parts/footer/search-popup' ); } } if ( ! function_exists( 'beetan_before_main_content_wrapper' ) ) { /** * Before main content wrapper */ function beetan_before_main_content_wrapper() { get_template_part( 'template-parts/global/before-main-content' ); } } if ( ! function_exists( 'beetan_after_main_content_wrapper' ) ) { /** * After main content wrapper */ function beetan_after_main_content_wrapper() { get_template_part( 'template-parts/global/after-main-content' ); } } if ( ! function_exists( 'beetan_before_loop_wrapper' ) ) { /** * Before loop wrapper */ function beetan_before_loop_wrapper() { get_template_part( 'template-parts/global/before-loop' ); } } if ( ! function_exists( 'beetan_after_loop_wrapper' ) ) { /** * After loop wrapper */ function beetan_after_loop_wrapper() { get_template_part( 'template-parts/global/after-loop' ); } } if ( ! function_exists( 'beetan_single_post_entry_header' ) ) { /** * Single post entry header */ function beetan_single_post_entry_header() { echo '
'; /** * Functions hooked in to beetan_single_post_entry_header_content action * * @hooked beetan_single_post_entry_title - 10 * @hooked beetan_single_post_entry_meta - 20 */ do_action( 'beetan_single_post_entry_header_content' ); echo '
'; } } if ( ! function_exists( 'beetan_single_post_entry_title' ) ) { /** * Single post entry title */ function beetan_single_post_entry_title() { if ( apply_filters( 'beetan_post_title_visibility', true ) ) { the_title( '

', '

' ); } } } if ( ! function_exists( 'beetan_single_post_entry_meta' ) ) { /** * Single post entry meta */ function beetan_single_post_entry_meta() { if ( 'post' === get_post_type() ) { beetan_entry_meta(); } } } if ( ! function_exists( 'beetan_page_entry_header' ) ) { /** * Single page entry title */ function beetan_page_entry_header() { if ( apply_filters( 'beetan_page_title_visibility', true ) ) { the_title( '

', '

' ); } } } if ( ! function_exists( 'beetan_payment_icons' ) ) { /** * Payment icons section */ function beetan_payment_icons_section() { get_template_part( 'template-parts/payment-icons' ); } }