', 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_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 ); } } /** * 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() ) ) { return true; } return false; } 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' ); } }