• hi,

    can you please tell me how to make my menu static? or sticky – to be seen when I go down on the page.
    thank you

Viewing 1 replies (of 1 total)
  • Hi..

    Please make child theme directory and create a functions.php and style.css file.

    Now copy below code and paste into style.css file of child theme’s directory.

    .sticky-header{
      top: 20px !important;
    }

    Also copy below code and paste into functions.php file of child theme’s directory.

    add_action( 'wp_footer', 'sticky_header' );
    function sticky_header(){
    	?>
    	<script>
    	jQuery(document).ready(function () {
    	jQuery(window).scroll(function () {
    	  if (jQuery(this).scrollTop() > 150) {
    	    jQuery('#header').addClass('sticky-header');
    	     } else {
    		jQuery('#header').removeClass('sticky-header');
    		  }
    		});
    	});
    	</script>
    	<?php
    }

    Save the changes.

    Thanks.

Viewing 1 replies (of 1 total)
  • The topic ‘Static menu’ is closed to new replies.