content_layout(); if ( \Razzi\Helper::is_blog() ) { $classes[] = 'razzi-blog-page'; } $classes[] = 'header-' . $header_type; if ( $header_type == 'default' ) { $classes[] = 'header-' . $header_layout; } if ( intval( Helper::get_option( 'header_sticky' ) ) ) { $classes[] = 'header-sticky'; } $get_id = \Razzi\Helper::get_post_ID(); $background = get_post_meta( $get_id, 'rz_header_background', true ); $background = apply_filters('razzi_get_header_background', $background); if ( 'transparent' == $background ) { $text_color = get_post_meta( $get_id, 'rz_header_text_color', true ); if ( $text_color != 'default' ) { $classes[] = 'header-transparent-text-' . $text_color; } $classes[] = 'header-' . $background; } if ( intval( Helper::get_option( 'boxed_layout' ) ) && get_post_meta( $get_id, 'rz_disable_page_boxed', true ) != '1' ) { if ( Helper::get_header_layout() != 'v6' ) { $classes[] = 'razzi-boxed-layout'; } } return $classes; } /** * Print the open tags of site content container * * @since 1.0.0 * * @return void */ public function open_site_content_container() { $container_class = 'container'; if ( is_page() ) { if(get_post_meta( Helper::get_post_ID(), 'rz_content_width', true ) == 'large' ) { $container_class = 'razzi-container'; } else { $container_class = ''; } if( Helper::is_catalog() && Helper::get_option('shop_catalog_layout') == 'grid' ) { if( Helper::get_option('catalog_content_width') == 'large' ) { $container_class = 'razzi-container'; } elseif( Helper::get_option('catalog_content_width') == 'wide' ) { $container_class = 'razzi-container-wide'; } else { $container_class = 'container'; } } } else { if( Helper::is_catalog() && Helper::get_option('shop_catalog_layout') == 'grid' ) { if( Helper::get_option('catalog_content_width') == 'large' ) { $container_class = 'razzi-container'; } elseif( Helper::get_option('catalog_content_width') == 'wide' ) { $container_class = 'razzi-container-wide'; } else { $container_class = 'container'; } } elseif( is_singular('product') ) { if( Helper::get_option('product_content_width') == 'large' ) { $container_class = 'razzi-container'; } elseif( Helper::get_option('product_content_width') == 'wide' ) { $container_class = 'razzi-container-wide'; } else { $container_class = 'container'; } } } if( ! empty($container_class) ) { echo sprintf('
', esc_attr( $container_class )); } } /** * Print the close tags of site content container * * @since 1.0.0 * * @return void */ public function close_site_content_container() { if ( is_page() ) { if(get_post_meta( Helper::get_post_ID(), 'rz_content_width', true ) == 'large' ) { echo '
'; } elseif( Helper::is_catalog() ) { echo ''; } } else { echo ''; } } /** * Get classes for primary content * * @since 1.0.0 * * @return string */ public function primary_content_classes() { $layout = $this->content_layout(); $classes = array( 'col-flex', 'col-flex-md-9', 'col-flex-sm-12', 'col-flex-xs-12' ); if ( $layout == 'full-content' ) { $classes = array( 'col-flex', 'col-flex-md-12', 'col-flex-xs-12' ); } if ( is_page() ) { $classes = array(); } return implode( ' ', $classes ); } /** * Get site layout * * @since 1.0.0 * * @return string */ public function content_layout() { $layout = 'full-content'; if ( is_singular( 'post' ) ) { if ( ! is_active_sidebar( 'blog-sidebar' ) ) { $layout = 'full-content'; } else { $layout = Helper::get_option( 'single_post_layout' ); } } else if ( \Razzi\Helper::is_blog() ) { if ( ! is_active_sidebar( 'blog-sidebar' ) ) { $layout = 'full-content'; } else { $layout = Helper::get_option( 'blog_layout' ); } } elseif ( \Razzi\Helper::is_catalog() && \Razzi\WooCommerce\Helper::get_catalog_layout() == 'grid' ) { if ( ! is_active_sidebar( 'catalog-sidebar' ) ) { $layout = 'full-content'; } else { $layout = Helper::get_option( 'catalog_sidebar' ); } } elseif( is_search() ) { if ( ! is_active_sidebar( 'blog-sidebar' ) ) { $layout = 'full-content'; } else { $layout = 'content-sidebar'; } } elseif ( is_singular('product') ) { if ( ! is_active_sidebar( 'single-product-sidebar' ) ) { $layout = 'full-content'; } else { $layout = Helper::get_option( 'product_sidebar' ); } } return apply_filters( 'razzi_site_layout', $layout ); } /** * Check has sidebar * * @since 1.0.0 * * @return boolean */ public function has_sidebar() { if( $this->content_layout() != 'full-content' ) { return true; } return false; } /** * Add classed to site content * * @since 1.0.0 * * @return string */ public function site_content_class($classes) { $post_id = get_the_ID(); if ( \Razzi\Helper::is_catalog() ) { $post_id = intval( get_option( 'woocommerce_shop_page_id' ) ); } if( is_page() || \Razzi\Helper::is_catalog() ) { $top_spacing = get_post_meta( $post_id, 'rz_content_top_spacing', true ); if ( ! empty($top_spacing) && $top_spacing != 'default' ) { $classes .= sprintf( ' %s-top-spacing', $top_spacing ); } $bottom_spacing = get_post_meta( $post_id, 'rz_content_bottom_spacing', true ); if ( ! empty($bottom_spacing) && $bottom_spacing != 'default' ) { $classes .= sprintf( ' %s-bottom-spacing', $bottom_spacing ); } } return $classes; } function register_elementor_locations( $elementor_theme_manager ) { $elementor_theme_manager->register_all_core_location(); } }