/
var
/
www
/
barefootlaw.org
/
wp-content
/
themes
/
barefoot
/
inc
/
basement
/
Upload File
HOME
<?php /** * Contains the main functions of the Basement framework. * This file is included if the plugin is deactivated. * * @package Aisconverse * @subpackage Covercase * @since Covercase 1.0 */ /** * Implement the Custom Header feature. * * @since Covercase 1.0 */ require( get_theme_file_path( 'inc/basement/custom-header.php' ) ); if ( ! function_exists( 'basement_assets' ) ) { /** * Enqueues Basement styles & scripts. * * @since Covercase 1.0 */ function basement_assets() { // Core Basement Plugins scripts (optional) wp_enqueue_script( 'covercase_basement_plugins', get_theme_file_uri( 'inc/basement/basement-plugins.min.js' ), array( 'jquery', 'covercase_script_plugins' ), COVERCASE_VERSION, true ); // All icons for Theme wp_enqueue_style( 'covercase_basement_styles', get_theme_file_uri( 'inc/basement/basement-front.min.css' ), array(), COVERCASE_VERSION ); } add_action( 'wp_enqueue_scripts', 'basement_assets', 5 ); } if ( ! function_exists( 'basement_body_class' ) ) { /** * Add class for body tag * * @since Covercase 1.0 */ function basement_body_class( $class ) { if ( basement_woo_active() ) { $class[] = 'woocommerce-native'; if ( basement_is_woo_grid_native() ) { $class[] = 'page-template-page-woo-classic'; } } $class[] = 'blog-native'; return $class; } add_filter( 'body_class', 'basement_body_class' ); } if ( ! function_exists( 'basement_header_class' ) ) { /** * Display the classes for the header element. * * @since Covercase 1.0 */ function basement_header_class( $class = '' ) { if ( is_singular( 'post' ) ) { $class .= ' menu_type_default header_sticky_enable logo_link_toggle_yes logo_position_left header_size_fullwidth header_bg_size_fullwidth header_off_no header_helper_no header_style_dark header affix-top'; } else { $class .= ' menu_type_default header_sticky_enable logo_link_toggle_yes logo_position_left header_size_fullwidth header_bg_size_fullwidth header_off_no header_helper_no header-light affix-top'; } echo 'class="' . esc_attr( $class ) . '"'; } } if ( ! function_exists( 'basement_navbar_class' ) ) { /** * Display the classes for the navbar element. * * @since Covercase 1.0 */ function basement_navbar_class( $class = '' ) { echo esc_attr( $class ) . ' container-fluid'; } } if ( ! function_exists( 'basement_page_title_class' ) ) { /** * Display the classes for the page title element. * * @since Covercase 1.0 */ function basement_page_title_class( $class = '' ) { $atts = ''; if ( is_singular( 'post' ) ) { $class .= ' page-title_placement_under pagetitle-dark pagetitle-inverse page-title_icon_no page-title_title_yes page-title_line_yes page-title_breadcrumbs_yes page-title_breadcrumbs_last_no page-title_position_center_right page-title_float_enable_no page-title_off_no page-title-sticky-disable'; $thumb = get_the_post_thumbnail_url(); if ( $thumb ) { $atts = ' style="background-image:url(' . esc_url( $thumb ) . ');" '; } } else { $class .= ' page-title_placement_under page-title_style_white page-title_icon_no page-title_title_yes page-title_line_yes page-title_breadcrumbs_no page-title_breadcrumbs_last_no page-title_position_center_right page-title_float_enable_no page-title_off_no page-title-sticky-disable'; } echo 'class="' . esc_attr( $class ) . '"' . $atts; } } if ( ! function_exists( 'basement_page_title_float_class' ) ) { /** * Display the classes for the page title float element. * * @since Covercase 1.0 */ function basement_page_title_float_class( $class = '' ) { echo 'class="' . esc_attr( $class ) . '"'; } } if ( ! function_exists( 'basement_plugin_active_for_network' ) ) { /** * Check Basement For Multisite * * @since Covercase 1.0 */ function basement_plugin_active_for_network( $plugin ) { if ( ! is_multisite() ) { return false; } $plugins = get_site_option( 'active_sitewide_plugins' ); if ( isset( $plugins[ $plugin ] ) ) { return true; } return false; } } if ( ! function_exists( 'basement_plugin_active' ) ) { /** * Check if plugin is enabled * * @since Covercase 1.0 */ function basement_plugin_active( $plugin ) { return in_array( $plugin, (array) get_option( 'active_plugins', array() ) ) || basement_plugin_active_for_network( $plugin ); } } if ( ! function_exists( 'basement_bcnavxt_active' ) ) { /** * Check if BCN plugin is enabled * * @since Covercase 1.0 */ function basement_bcnavxt_active() { return basement_plugin_active( 'breadcrumb-navxt/breadcrumb-navxt.php' ); } } if ( ! function_exists( 'basement_cf7_active' ) ) { /** * Check if CF 7 is enabled * * @since Covercase 1.0 */ function basement_cf7_active() { return basement_plugin_active( 'contact-form-7/wp-contact-form-7.php' ); } } if ( ! function_exists( 'basement_revslider_active' ) ) { /** * Check if RS is enabled * * @since Covercase 1.0 */ function basement_revslider_active() { return basement_plugin_active( 'revslider/revslider.php' ); } } if ( ! function_exists( 'basement_woo_active' ) ) { /** * Check if WooCommerce is enabled * * @since Covercase 1.0 */ function basement_woo_active() { return basement_plugin_active( 'woocommerce/woocommerce.php' ); } } if ( ! function_exists( 'basement_framework_active' ) ) { /** * Check if Basement Framework Enable * * @since Covercase 1.0 */ function basement_framework_active() { return basement_plugin_active( 'basement-framework/basement-framework.php' ); } } if ( ! function_exists( 'basement_vc_active' ) ) { /** * Check if Visual Composer Enable * * @since Covercase 1.0 */ function basement_vc_active() { return basement_plugin_active( 'js_composer/js_composer.php' ); } } if ( ! function_exists( 'basement_wpml_active' ) ) { /** * Check if WPML Enable * * @since Covercase 1.0 */ function basement_wpml_active() { // Hack is language not set $wpml_options = get_option( 'icl_sitepress_settings' ); $default_lang = isset( $wpml_options['default_language'] ) ? $wpml_options['default_language'] : ''; if ( $default_lang ) { $default_lang = true; } else { $default_lang = false; } return ( basement_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) && $default_lang ) || ( defined( 'FAKE_WPML' ) && FAKE_WPML ); } } if ( ! function_exists( 'basement_is_blog' ) ) { /** * Detect ALL blog pages (with custom templates & single posts) * * @since Covercase 1.0 */ function basement_is_blog() { return 'post' === get_post_type() || is_singular( 'post' ) || basement_is_blog_grid(); } } if ( ! function_exists( 'basement_is_blog_grid' ) ) { /** * Detect only pages with posts grid e.g: index.php or archive.php etc (with custom templates) * * @since Covercase 1.0 */ function basement_is_blog_grid() { $template_name = get_page_template_slug( get_queried_object_id() ); return basement_is_blog_grid_native() || strpos( $template_name, 'page-blog' ) !== false; } } if ( ! function_exists( 'basement_is_blog_grid_native' ) ) { /** * Detect ONLY default WP blog blog pages exclude taxes & single posts! * * @since Covercase 1.0 */ function basement_is_blog_grid_native() { return is_home() || is_category() || is_tag() || is_date() || is_author(); } } if ( ! function_exists( 'basement_get_template_name' ) ) { /** * Get Current Template Name * * @since Covercase 1.0 */ function basement_get_template_name( $type = null ) { // Load template name from some current page $template_name = get_page_template_slug( get_queried_object_id() ); // IF IS BLOG = Load template name from some current page if ( basement_is_blog_grid_native() ) { $template_name = 'blog/page-blog-classic.php'; } // IF IS WOOCOMMERCE GRID = Load template name from GLOBAL theme settings if ( basement_is_woo_grid_native() ) { // If current template is empty $template_name = 'woocommerce/page-woo-classic.php'; } // Get template name return str_replace( array( 'blog/', '.php' ), '', ! empty( $template_name ) ? $template_name : '' ); } } if ( ! function_exists( 'basement_output_footer' ) ) { /** * Output Static Footer * * @since Covercase 1.0 */ function basement_output_footer() { ?> </div> <!-- /.wrapper --> <!-- FOOTER --> <footer role="contentinfo" class="footer footer_yes footer_line_no footer_style_dark footer_sticky_disable footer_size_boxed footer_animation_disable footer_animation_bounce scope_public footer_type_blog"> <div class="footer-row" aria-label="<?php esc_attr_e( 'Blog Sidebar', 'covercase' ); ?>"> <div class="container"> <?php get_sidebar(); ?> </div> </div> </footer> <!-- /.footer --> </section> <!-- /.wrapper-main --> </div> <!-- /.wrapper-full --> <!-- SCROLLTOP --> <a href="#" class="scrolltop" title="<?php esc_attr_e( 'Scroll to top', 'covercase' ) ?>"></a> <!-- /.scrolltop --> <?php } add_action( 'basement_footer', 'basement_output_footer' ); } if ( ! function_exists( 'basement_output_content_header' ) ) { /** * Output Header Elements * * @since Covercase 1.0 */ function basement_output_content_header() { ?> <div class="body-navbar clearfix"> <?php $header_parts = array( 'logo', 'lang', 'shop', 'account', 'search', 'separator', 'menu' ); foreach ( $header_parts as $part ) { if ( 'separator' === $part ) { echo '<div class="navbar-divider pull-right"></div>'; } else { get_template_part( 'template-parts/header/' . $part ); } } ?> </div> <?php } add_action( 'basement_content_header', 'basement_output_content_header' ); } if ( ! function_exists( 'basement_output_before_wrapper' ) ) { /** * Output Elements Before Wrapper (modals, search etc) * * @since Covercase 1.0 */ function basement_output_before_wrapper() { $header_parts = array( 'menu-simple', 'search-form' ); foreach ( $header_parts as $part ) { get_template_part( 'template-parts/header/' . $part ); } } add_action( 'basement_before_wrapper', 'basement_output_before_wrapper', 14 ); } if ( ! function_exists( 'basement_output_before_page_title_float' ) ) { /** * Hide Float Page Title (start) * * @since Covercase 1.0 */ function basement_output_before_page_title_float() { ob_start(); } add_action( 'basement_before_page_title_float', 'basement_output_before_page_title_float' ); } if ( ! function_exists( 'basement_output_after_page_title_float' ) ) { /** * Hide Float Page Title (finish) * * @since Covercase 1.0 */ function basement_output_after_page_title_float() { ob_end_clean(); } add_action( 'basement_after_page_title_float', 'basement_output_after_page_title_float' ); } if ( ! function_exists( 'basement_output_before_page_title' ) ) { /** * Hide Page Title for Single Product (start) * * @since Covercase 1.0 */ function basement_output_before_page_title() { if ( is_singular( 'product' ) ) { ob_start(); } } add_action( 'basement_before_page_title', 'basement_output_before_page_title' ); } if ( ! function_exists( 'basement_output_after_page_title' ) ) { /** * Hide Page Title for Single Product (end) * * @since Covercase 1.0 */ function basement_output_after_page_title() { if ( is_singular( 'product' ) ) { ob_end_clean(); } } add_action( 'basement_after_page_title', 'basement_output_after_page_title' ); } if ( ! function_exists( 'basement_output_after_header' ) ) { /** * Output header helper for Single Product * * @since Covercase 1.0 */ function basement_output_after_header() { if ( is_singular( 'product' ) ) { echo '<div class="header-helper"></div>'; } } add_action( 'basement_after_header', 'basement_output_after_header' ); } if ( ! function_exists( 'basement_output_content_page_title' ) ) { /** * Displays Page Title Content * * @since Covercase 1.0 */ function basement_output_content_page_title() { get_template_part( 'template-parts/page-title/page-title' ); } add_action( 'basement_content_page_title', 'basement_output_content_page_title' ); } if ( ! function_exists( 'basement_is_woo_pages' ) ) { /** * Check if current pages is WooCommerce * * @since Covercase 1.0 */ function basement_is_woo_pages() { if ( ! basement_woo_active() ) { return false; } return is_woocommerce() || is_checkout() || is_account_page() || is_cart() || is_checkout_pay_page() || is_edit_account_page(); } } if ( ! function_exists( 'basement_output_content_wrapper' ) ) { /** * Start main content wrapper * * @since Covercase 1.0 */ function basement_output_content_wrapper() { $classes = array( 'page-content-cell maincontent col-12' ); ?> <!-- MAIN CONTENT --> <div class="<?php echo implode( ' ', $classes ) ?>" role="main"> <?php echo ( basement_is_blog_grid() || is_search() ) && ! basement_is_woo_search() ? '<div class="row">' : ''; } add_action( 'basement_before_content', 'basement_output_content_wrapper', 21 ); } if ( ! function_exists( 'basement_output_content_wrapper_end' ) ) { /** * End main content wrapper * * @since Covercase 1.0 */ function basement_output_content_wrapper_end() { echo ( basement_is_blog_grid() || is_search() ) && ! basement_is_woo_search() ? '</div>' : ''; ?> </div> <!-- ./main-content --> <?php } add_action( 'basement_after_content', 'basement_output_content_wrapper_end', 19 ); } if ( ! function_exists( 'basement_is_woo_search' ) ) { /** * Check if current page is Product Search * * @since Covercase 1.0 */ function basement_is_woo_search() { $search_request = isset( $_GET['post_type'] ) ? $_GET['post_type'] : ''; return is_search() && 'product' === $search_request; } } if ( ! function_exists( 'basement_is_woo_grid_native' ) ) { /** * Check if current page is WooCommerce native Grid * * @since Covercase 1.0 */ function basement_is_woo_grid_native() { if ( ! basement_woo_active() ) { return false; } return is_product_tag() || is_product_taxonomy() || is_post_type_archive( 'product' ) || is_product_category(); } } if ( ! function_exists( 'basement_the_specific_title' ) ) { /** * Displays title for specific page * * @since Covercase 1.0 */ function basement_the_specific_title( $type = '', $user_title = '', $echo = true ) { if ( ! $type ) { return false; } $title = get_option( "basement_framework_page_title_custom_{$type}" ); if ( empty( $title ) ) { $title = $user_title; } if ( $echo ) { echo esc_html($title); } else { return esc_html($title); } } }