%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/shaban/laviva/wp-content/themes/levelup/inc/
Upload File :
Create Path :
Current File : /var/www/html/shaban/laviva/wp-content/themes/levelup/inc/custom-header.php

<?php

function levelup_custom_header_setup() {
    add_theme_support( 'custom-header', apply_filters( 'levelup_custom_header_args', array(
        'default-image'          => '',
        'default-text-color'     => '000000',
        'width'                  => 1000,
        'height'                 => 250,
        'flex-height'            => true,
    ) ) );
}
add_action( 'after_setup_theme', 'levelup_custom_header_setup' );


if ( ! function_exists( 'levelup_header_style' ) ) {

    function levelup_header_style() {
        global $levelup_options;

        $config = levelup_config();

        $levelup_header_height = esc_attr( $levelup_options['header-height'] );
        $levelup_header_topbar_height = esc_attr( $levelup_options['header-topbar-height'] );

        $header_height = (!empty($levelup_header_height) && $levelup_header_height > 0) ? $levelup_header_height : 150;


        ob_start();
        ?>
            #header-menu.slidedown-layout,
            #header-menu.fixed-layout,
            #header-menu.static-layout,
            #header-menu.fixed-layout .container,
            #header-menu.static-layout .container
            {
                height: <?php echo (!empty($levelup_header_height) && $levelup_header_height > 0) ? $levelup_header_height : 150;?>px;
            }

            @media only screen and (min-width: 992px){
                body.admin-bar #header-search {
                    top: 32px
                }
                <?php if ( $config->get('siteheader.layout') == 'fixed' || $config->get('siteheader.layout') == 'static' ) { ?>
                #header,
                #header-menu {
                    top: auto;
                }
                #header #logo,
                #header .menu-right-side {
                    height: <?php echo (!empty($levelup_header_height) && $levelup_header_height > 0) ? $levelup_header_height : 150;?>px;
                    top: 0;
                }

                <?php if ( $levelup_options['header-topbar-enable'] && esc_attr( $levelup_header_topbar_height ) ) { ?>
                #top-bar {
                    height: <?php echo esc_attr( $levelup_header_topbar_height );?>px;
                    line-height: <?php echo esc_attr( $levelup_header_topbar_height );?>px !important;
                }
                <?php if ( $config->get('siteheader.layout') == 'fixed' && $levelup_options['header-topbar-position'] == 'sticky' ) { ?>
                #page {
                    padding-top:  <?php echo esc_attr( $levelup_header_topbar_height );?>px;
                }
                #header,
                #header-menu {
                    margin-top:  <?php echo esc_attr( $levelup_header_topbar_height );?>px;
                }
                <?php } ?>
                <?php } ?>

                <?php } ?>

            }

            <?php if ( $config->get('siteheader.layout') == 'fixed' || $config->get('siteheader.layout') == 'static' ) { ?>
            <?php if ( !$levelup_options['logo-top-stick'] ) { ?>
            #header:not(.with-columns) #logo .logo-holder,<?php } ?>
            #header:not(.with-columns) .menu-right-side .side-icon {
                top: 50%;
                -webkit-transform: translateY(-50%);
                -moz-transform: translateY(-50%);
                -o-transform: translateY(-50%);
                -ms-transform: translateY(-50%);
                transform: translateY(-50%);
            }

            <?php //if ( $levelup_options['header-align'] == 'right' ):
                $margin_right = 15;

                if ($levelup_options['header-search-enable']) $margin_right += 60;
                if ( $levelup_options['header-hamburger-text-enable'] && $config->get('siteheader.layout.gamburg')) $margin_right += 60;
                if ( $levelup_options['header-cart-enable'] && in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) $margin_right += 60;

                if ( $margin_right > 0 ) {
                    if ( empty($levelup_options['header-fullwidth']) ) {
                        $margin_right += 20;
                    } else {
                        $margin_right += 45;
                    }
                }
            ?>
            #header-menu #main-menu {
                margin-right: <?php echo esc_attr( $margin_right );?>px;
            }
            <?php //endif; ?>
            <?php } elseif ($config->get('siteheader.layout.gamburg')) { ?>
            <?php if ( !empty($levelup_options['logo-top-stick']) && $levelup_options['logo-top-stick'] ) { ?>
            .zlogo {<?php if ( is_admin_bar_showing() ): ?>top: 32px;<?php else: ?>top: 0;<?php endif; ?>}
            <?php } ?>
            <?php } ?>

            <?php if($config->get('siteheader.layout.gamburg') && false): ?>
                #page {
                <?php if ( is_admin_bar_showing() ) { ?>
                    padding-top: <?php echo (!empty($levelup_header_height) && $levelup_header_height > 0) ? $levelup_header_height - 32 : 0;?>px;
                <?php } else { ?>
                    padding-top: <?php echo (!empty($levelup_header_height) && $levelup_header_height > 0) ? $levelup_header_height : 0;?>px;
                <?php } ?>
                }
            <?php endif; ?>

            <?php if ( is_admin_bar_showing() ) { ?>
                #header_spacer {
                    height: <?php echo esc_attr( $header_height ); ?>px;
                }
            <?php }else{ ?>
                #header_spacer {
                    height: <?php echo esc_attr( $header_height );?>px;
                }
            <?php } ?>
            <?php
                if (
	                !$levelup_options['header-background'] ||
	                ($config->get('siteheader.background_appear') && $config->get( 'siteheader.layout' ) != 'static') ||
                    ($config->get('header.transparent') && ($config->get( 'siteheader.layout' ) == 'fixed' || $config->get( 'siteheader.layout' ) == 'static'))
                ) { ?>
                @media screen and (min-width: 992px){
                    #header_spacer {
                        display: none;
                    }
                }

            <?php } ?>
            <?php
                if ( $config->get( 'siteheader.mobile.stiky' ) ) { ?>
                @media screen and (max-width: 992px){
                    #header_spacer {
                        height: 60px !important;
                        display: block !important;
                    }
                }
            <?php } ?>
            <?php if ( $config->get('header.transparent') && $config->get( 'siteheader.layout' ) == 'fixed' ) {?>
                #header-menu {
                    background-color: transparent;
                }
            <?php } ?>

            <?php if ($config->get('siteheader.layout') == 'fixed' || $config->get('siteheader.layout') == 'static'):?>
            .rdy-menu > li {
                height: <?php echo esc_attr( $header_height ); ?>px;
            }
            .rdy-menu > li > a,
            .rdy-menu > li > .title {
                line-height: <?php echo esc_attr( $header_height ); ?>px !important;
            }
            <?php endif; ?>

            <?php if ( is_admin_bar_showing() ) { ?>
            #header-menu.static-layout #main-menu {
                margin-top: 0 !important;
            }
            <?php } ?>

            <?php if ( !$levelup_options['use-logo'] ) { ?>
                #main-menu {
                    margin-left: 0;
                }
            <?php } ?>

            <?php if ( 'rdy_project' == get_post_type() && !is_singular() ) { ?>
                html {
                    margin: 0;
                    padding: 0;
                    width: 100%;
                    height: 100%;
                    overflow: hidden;
                }
            <?php } ?>
            <?php if ($levelup_options['general-custom-css2']){ echo wp_strip_all_tags( $levelup_options['general-custom-css2'] ); }?>
            <?php
            if ( $config->get('page.bg.color') || $config->get('page.bg.image') ) {
                $background_style = array();

                $image_meta = wp_get_attachment_image_src( $config->get('page.bg.image'), 'full' );
                if ( $image_meta ) {

                    if ( $config->get('page.bg.fullscreen') ) {
                        $bg_size = 'cover';
                        $repeat = 'no-repeat';
                    } else {
                        $bg_size = 'auto auto';
                        $repeat = esc_attr( $config->get('page.bg.repeat') );
                    }

                    $background_style[] = "background-size: {$bg_size} !important";
                    $background_style[] = "background-repeat: {$repeat} !important";
                    $background_style[] = "background-image: url(" . esc_url( $image_meta[0] ) . ") !important";


                    if ( $config->get('page.bg.fixed') ) {
                        $background_style[] = 'background-attachment: fixed !important';
                    }

                    $position_x = esc_attr( $config->get('page.bg.position.x') );
                    $position_y = esc_attr( $config->get('page.bg.position.y') );
                    $background_style[] = "background-position: {$position_x} {$position_y} !important";

                }


	            if ( $config->get('page.bg.color') ) {
		            $background_style[] = 'background-color: ' . esc_attr( $config->get('page.bg.color') .' !important' );
		            if ( empty( $image_meta ) ) {
			            $background_style[] = 'background-image: none !important';
		            }
	            }

	            ?>
                body, body.footer-uncovering #page { <?php echo esc_attr( implode( '; ', $background_style ) );?> }
            <?php } ?>

            <?php

            if ( levelup_get_options('footer-effects') == 'uncovering' && !empty($levelup_options['footer-shadow']) ) {

                if ( $levelup_options['footer-shadow'] == 'shadow1' ) {
                    $shadow_preset = 'box-shadow: 0 40px 50px -20px';
                } elseif ( $levelup_options['footer-shadow'] == 'shadow2' ) {
                    $shadow_preset = 'box-shadow: 0 20px 50px -20px';
                } elseif ( $levelup_options['footer-shadow'] == 'shadow3' ) {
                    $shadow_preset = 'box-shadow: 0 20px 20px -20px';
                } elseif ( $levelup_options['footer-shadow'] == 'shadow4' ) {
                    $shadow_preset = 'box-shadow: 0 10px 40px 15px';
                } elseif ( $levelup_options['footer-shadow'] == 'shadow5' ) {
                    $shadow_preset = 'box-shadow: 0 15px 50px 20px';
                } elseif ( $levelup_options['footer-shadow'] == 'shadow6' ) {
                    $shadow_preset = 'box-shadow: 0 30px 50px 25px';
                }

                $footet_shadow = $shadow_preset . ' ' . ( ! empty( $levelup_options['footer-shadow-color']['rgba'] ) ? esc_attr( $levelup_options['footer-shadow-color']['rgba'] ) : 'rgba(0,0,0,1)' );
            ?>
            #page {
                <?php echo $footet_shadow; ?>
            }
            <?php } ?>

            <?php
            if ( ! empty( $levelup_options['footer-sub-opacity-enable'] ) && ! empty( $levelup_options['footer-sub-opacity'] ) ) { ?>
                html.no-touch #bottom-bar > div {
                    opacity: <?php echo levelup_convert_opacity( $levelup_options['footer-sub-opacity'] ); ?>;
                    transition: opacity .3s;
                }
                html.no-touch #bottom-bar:hover > div {
                    opacity: 1;
                }
            <?php }
            ?>

        <?php

        $custom_css = ob_get_clean();

        wp_add_inline_style( 'levelup_main', apply_filters( 'levelup_dynamic_css', $custom_css ) );
    }

}
add_action( 'wp_enqueue_scripts', 'levelup_header_style', 16 );


Zerion Mini Shell 1.0