classes(); } add_filter( 'tempo_front_page_section_length', 'beauty_land_front_page_section_length' ); /** * Singular Post / Page Section Length */ function beauty_land_singular_section_length( $length, $post_id ) { if( empty( $post_id ) ) return; $post = get_post( $post_id ); $layout = new tempo_layout( $post -> post_type ); return $layout -> classes(); } add_filter( 'tempo_page_section_length', 'beauty_land_singular_section_length', 10, 2 ); add_filter( 'tempo_single_section_length', 'beauty_land_singular_section_length', 10, 2 ); /** * Loop Section Length + Blog View Class */ function beauty_land_loop_section_length( $layout ) { $layout = new tempo_layout(); return esc_attr( $layout -> classes() . ' tempo-blog-' . tempo_options::get( 'blog-view' ) ); } add_filter( 'tempo_loop_section_length', 'beauty_land_loop_section_length' ); ///// SIDEBARS ACTIONS ///// /** * Left Sidebars */ function beauty_land_left_sidebar( $slug, $name ) { if( is_404() ) return; /** * get sidebar */ $layout = new tempo_layout( $name ); if( is_singular() && !( is_front_page() || is_home() ) ){ global $post; $layout = new tempo_layout( $name ); } // left sidebar $layout -> sidebar( 'left' ); } add_action( 'get_template_part_templates/section/before', 'beauty_land_left_sidebar', 10, 2 ); /** * Right Sidebars */ function beauty_land_right_sidebar( $slug, $name ) { if( is_404() ) return; /** * get sidebar */ $layout = new tempo_layout( $name ); if( is_singular() && !( is_front_page() || is_home() ) ){ global $post; $layout = new tempo_layout( $name ); } // right sidebar $layout -> sidebar( 'right' ); } add_action( 'get_template_part_templates/section/after', 'beauty_land_right_sidebar', 10, 2 ); } { //// HEADER /** * Disable default parent custom style */ function beauty_land_not_has_header() { return !tempo_has_header(); } add_filter( 'tempo_site_identity_style', 'beauty_land_not_has_header' ); add_filter( 'tempo_menu_style', 'beauty_land_not_has_header' ); function beauty_land_customize_js_files( $files ) { $files[ 'beauty-land-customize' ] = get_stylesheet_directory_uri() . '/media/admin/js/customize.js'; return $files; } add_filter( 'tempo_customize_js_files', 'beauty_land_customize_js_files' ); function beauty_land_mix_height() { $headline = tempo_options::get( 'header-headline' ); $description = tempo_options::get( 'header-description' ); $btn_1 = tempo_options::get( 'header-btn-1' ); $btn_2 = tempo_options::get( 'header-btn-2' ); return ( $headline || $description ) && ( $btn_1 || $btn_2 ); } function beauty_land_header_height( $height ) { if( beauty_land_mix_height() ) $height = tempo_options::get( 'header-text-space' ) + tempo_options::get( 'header-btns-space' ); return $height; } add_filter( 'tempo_header_height', 'beauty_land_header_height' ); /** * Flex Container - get vertical position from plugin settings */ function beauty_land_flex_container_class( $valign ) { if( empty( $valign ) && $mix_height = beauty_land_mix_height() ) $valign = 'tempo-valign-' . tempo_options::get( 'header-text-vertical-align' ); return esc_attr( trim( $valign ) ); } add_filter( 'tempo_flex_container_class', 'beauty_land_flex_container_class' ); /** * Flex text Container - get style */ function beauty_land_header_text_wrapper_style( $style ) { if( beauty_land_mix_height() ) $style = 'beauty-land:true; height: ' . absint( tempo_options::get( 'header-text-space' ) ) . 'px;'; return $style; } add_filter( 'tempo_header_text_wrapper_style', 'beauty_land_header_text_wrapper_style' ); /** * Flex Item - get horizontal position from plugin settings */ function beauty_land_flex_item_class( $align ) { if( empty( $align ) ) $align = 'tempo-align-' . tempo_options::get( 'header-horizontal-align' ); return esc_attr( trim( $align ) ); } add_filter( 'tempo_flex_item_class', 'beauty_land_flex_item_class' ); } /** * Comments Submit button Classes */ function beauty_land_submi_comment_class( $classes ) { return 'tempo-btn btn-hover-empty icon-left'; } add_filter( 'tempo_submi_comment_class', 'beauty_land_submi_comment_class' ); /** * Footer Social */ function beauty_land_footer_social( $slug, $name ) { tempo_get_template_part( 'templates/footer/prepend-social' ); } add_action( 'get_template_part_templates/footer/prepend', 'beauty_land_footer_social', 10, 2 ); /** * Footer Dark Sidebars */ function beauty_land_merge_footer_dark_sidebars( $cfgs ) { $cfgs[ 'footer' ][ 'footer-dark' ] = array( 'id' => 'footer-dark', 'name' => __( 'Footer Dark Side' , 'beauty-land' ), 'description' => __( 'Inside of the Sidebar the widgets will be arranged in 4 columns.' , 'beauty-land' ), 'before_widget' => '
', 'before_title' => '