Tagged: header, scrolled header, sticky header
-
AuthorPosts
-
February 3, 2021 at 4:49 pm #1277420
Hello :)
I am doing updates for my wp site and copied everything to a dev server.
Now here’s the problem:
On my live site the Header/Menu is scrolling unchanged on the home site and on other sites ist turns small and gets white background.
On my dev site the header/menu on home has the same behavior as on all sites but I want it to be the same as on the live site.
The difference is that the live home-site has no classes “header-scrolled” and ‘header-scrolled-full” on the header element but the dev home-site has these classes.Any suggestions what to do?
Thanks, gugler
February 4, 2021 at 7:28 am #1277604Hi gugler,
To prevent homepage’s header from scrolling, please add this CSS code in Enfold > General Styling > Quick CSS:
#top.home #header { position: absolute !important; }
Best regards,
NikkoFebruary 4, 2021 at 9:10 am #1277631Hi Nikko,
thanks for your replay!
I don’t want prevent the header from scrolling, I want to prevent that the classes “header-scrolled” and “header-scrolled-full” are appended.
So that the header scrolls but it don’t get minimized and a background-color.
In my private data you can see what I want (live) and what I have (dev) after the updates.Thanks, gugler
February 6, 2021 at 5:35 pm #1278314Hi gugler,
Please check the header behavior now.
Best regards,
VictoriaFebruary 8, 2021 at 8:40 am #1278567Hi Victoria,
thanks for your help! I can see you turned off the shrinking header. That was my idea as well but I need the header to shrink on all sites except the home site.
I tried this code in the functions.php:
add_filter('avf_header_setting_filter', 'avf_header_setting_filter_mod', 50, 1); function avf_header_setting_filter_mod($header_settings) { if ( !is_front_page() ) { $header_settings['header_sticky'] = 'header_sticky'; $header_settings['header_shrinking'] = "header_shrinking"; } return $header_settings; }
But it isn’t working. Any ideas?
Best regards,
gugler- This reply was modified 3 years, 10 months ago by gugler.
February 8, 2021 at 5:49 pm #1278732Hi gugler,
You need to set the logo in the Header > Transparency options, so that you don’t get the Kriesi logo :)
You have the header.php file in your child theme, is it from the same version as the parent theme now?
Best regards,
VictoriaFebruary 9, 2021 at 2:51 pm #1279097Hi Victoria,
I know, this was just a test in order to see if is_front_page() is working :)
I dont think so we use a custom header.php. I think the custom header.php was created during another version.
Child theme version:<?php global $avia_config; $style = $avia_config['box_class']; $responsive = avia_get_option('responsive_active') != "disabled" ? "responsive" : "fixed_layout"; $blank = isset($avia_config['template']) ? $avia_config['template'] : ""; $av_lightbox= avia_get_option('lightbox_active') != "disabled" ? 'av-default-lightbox' : 'av-custom-lightbox'; $preloader = avia_get_option('preloader') == "preloader" ? 'av-preloader-active av-preloader-enabled' : 'av-preloader-disabled'; $sidebar_styling = avia_get_option('sidebar_styling'); ?><!DOCTYPE html> <html <?php language_attributes(); ?> class="<?php echo " html_{$style} ".$responsive." ".$preloader." ".$av_lightbox." ".avia_header_class_string();?> "> <head> <meta name="format-detection" content="telephone=no"> <meta charset="<?php bloginfo( 'charset' ); ?>" /> <!-- page title, displayed in your browser bar --> <title><?php if(function_exists('avia_set_title_tag')) { echo avia_set_title_tag(); } ?></title> <?php /* * outputs a rel=follow or nofollow tag to circumvent google duplicate content for archives * located in framework/php/function-set-avia-frontend.php */ if (function_exists('avia_set_follow')) { echo avia_set_follow(); } /* * outputs a favicon if defined */ if (function_exists('avia_favicon')) { echo avia_favicon(avia_get_option('favicon')); } ?> <!-- mobile setting --> <?php if( strpos($responsive, 'responsive') !== false ) echo '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">'; ?> <!-- Scripts/CSS and wp_head hook --> <?php /* Always have wp_head() just before the closing </head> * tag of your theme, or you will break many plugins, which * generally use this hook to add elements to <head> such * as styles, scripts, and meta tags. */ wp_head(); ?> <link rel="shortcut icon" href="/favicon.ico"> <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> <link rel="manifest" href="/site.webmanifest"> <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#1d1d1b"> <meta name="msapplication-TileColor" content="#1d1d1b"> <meta name="theme-color" content="#1d1d1b"> </head> <body id="top" <?php body_class($style." ".$avia_config['font_stack']." ".$blank." ".$sidebar_styling); avia_markup_helper(array('context' => 'body')); ?>> <?php if("av-preloader-active av-preloader-enabled" === $preloader) { echo avia_preload_screen(); } ?> <div id='wrap_all'> <?php if(!$blank) //blank templates dont display header nor footer { //fetch the template file that holds the main menu, located in includes/helper-menu-main.php get_template_part( 'includes/helper', 'main-menu' ); } ?> <div id='main' data-scroll-offset='<?php echo avia_header_setting('header_scroll_offset'); ?>'> <?php if(isset($avia_config['temp_logo_container'])) echo $avia_config['temp_logo_container']; do_action('ava_after_main_container'); ?> <?php if ( is_page('Museen') ) { dynamic_sidebar( 'museen-sidebar' ); } ?>
Parent theme version:
<?php if ( ! defined('ABSPATH') ){ die(); } global $avia_config; $lightbox_option = avia_get_option( 'lightbox_active' ); $avia_config['use_standard_lightbox'] = empty( $lightbox_option ) || ( 'lightbox_active' == $lightbox_option ) ? 'lightbox_active' : 'disabled'; /** * Allow to overwrite the option setting for using the standard lightbox * Make sure to return 'disabled' to deactivate the standard lightbox - all checks are done against this string * * @added_by Günter * @since 4.2.6 * @param string $use_standard_lightbox 'lightbox_active' | 'disabled' * @return string 'lightbox_active' | 'disabled' */ $avia_config['use_standard_lightbox'] = apply_filters( 'avf_use_standard_lightbox', $avia_config['use_standard_lightbox'] ); $style = $avia_config['box_class']; $responsive = avia_get_option( 'responsive_active' ) != 'disabled' ? 'responsive' : 'fixed_layout'; $blank = isset( $avia_config['template'] ) ? $avia_config['template'] : ''; $av_lightbox = $avia_config['use_standard_lightbox'] != 'disabled' ? 'av-default-lightbox' : 'av-custom-lightbox'; $preloader = avia_get_option( 'preloader' ) == 'preloader' ? 'av-preloader-active av-preloader-enabled' : 'av-preloader-disabled'; $sidebar_styling = avia_get_option( 'sidebar_styling' ); $filterable_classes = avia_header_class_filter( avia_header_class_string() ); $av_classes_manually = 'av-no-preview'; /*required for live previews*/ /** * If title attribute is missing for an image default lightbox displays the alt attribute * * @since 4.7.6.2 * @param bool * @return false|mixed anything except false will activate this feature */ $mfp_alt_text = false !== apply_filters( 'avf_lightbox_show_alt_text', false ) ? 'avia-mfp-show-alt-text' : ''; /** * Allows to alter default settings Enfold-> Main Menu -> General -> Menu Items for Desktop * @since 4.4.2 */ $is_burger_menu = apply_filters( 'avf_burger_menu_active', avia_is_burger_menu(), 'header' ); $av_classes_manually .= $is_burger_menu ? ' html_burger_menu_active' : ' html_text_menu_active'; /** * Add additional custom body classes * e.g. to disable default image hover effect add av-disable-avia-hover-effect * * @since 4.4.2 */ $custom_body_classes = apply_filters( 'avf_custom_body_classes', '' ); /** * @since 4.2.3 we support columns in rtl order (before they were ltr only). To be backward comp. with old sites use this filter. */ $rtl_support = 'yes' == apply_filters( 'avf_rtl_column_support', 'yes' ) ? ' rtl_columns ' : ''; ?><!DOCTYPE html> <html <?php language_attributes(); ?> class="<?php echo "html_{$style} {$responsive} {$preloader} {$av_lightbox} {$filterable_classes} {$av_classes_manually}" ?> "> <head> <meta charset="<?php bloginfo( 'charset' ); ?>" /> <?php /* * outputs a rel=follow or nofollow tag to circumvent google duplicate content for archives * located in framework/php/function-set-avia-frontend.php */ if( function_exists( 'avia_set_follow' ) ) { echo avia_set_follow(); } ?> <!-- mobile setting --> <?php $meta_viewport = ( strpos( $responsive, 'responsive' ) !== false ) ? '<meta name="viewport" content="width=device-width, initial-scale=1">' : ''; /** * @since 4.7.6.4 * @param string * @return string */ echo apply_filters( 'avf_header_meta_viewport', $meta_viewport ); ?> <!-- Scripts/CSS and wp_head hook --> <?php /* Always have wp_head() just before the closing </head> * tag of your theme, or you will break many plugins, which * generally use this hook to add elements to <head> such * as styles, scripts, and meta tags. */ wp_head(); ?> </head> <body id="top" <?php body_class( $custom_body_classes . ' ' . $mfp_alt_text .' ' . $rtl_support . $style . ' ' . $avia_config['font_stack'] . ' ' . $blank . ' ' . $sidebar_styling); avia_markup_helper( array( 'context' => 'body' ) ); ?>> <?php /** * WP 5.2 add a new function - stay backwards compatible with older WP versions and support plugins that use this hook * https://make.wordpress.org/themes/2019/03/29/addition-of-new-wp_body_open-hook/ * * @since 4.5.6 */ if( function_exists( 'wp_body_open' ) ) { wp_body_open(); } else { do_action( 'wp_body_open' ); } do_action( 'ava_after_body_opening_tag' ); if( 'av-preloader-active av-preloader-enabled' === $preloader ) { echo avia_preload_screen(); } ?> <div id='wrap_all'> <?php if( ! $blank ) //blank templates dont display header nor footer { //fetch the template file that holds the main menu, located in includes/helper-menu-main.php get_template_part( 'includes/helper', 'main-menu' ); } ?> <div id='main' class='all_colors' data-scroll-offset='<?php echo avia_header_setting( 'header_scroll_offset' ); ?>'> <?php if( isset( $avia_config['temp_logo_container'] ) ) { echo $avia_config['temp_logo_container']; } do_action( 'ava_after_main_container' );
February 11, 2021 at 4:16 pm #1279791Hi gugler,
Can you try to update your child theme’s header.php file? so it’s updated and make sure no functionality is disabled.
Also enable both shrinking and sticky header then use this php code instead in your child theme’s functions.php file:add_filter('avf_header_setting_filter', 'avf_header_setting_filter_mod', 50, 1); function avf_header_setting_filter_mod($header_settings) { if ( is_front_page() ) { $header_settings['header_sticky'] = 'disabled'; $header_settings['header_shrinking'] = 'disabled'; } return $header_settings; }
Best regards,
Nikko -
AuthorPosts
- You must be logged in to reply to this topic.