Reply To: Make Header Stick to Top of Page with Menu

Home Forums WordPress Themes – Premium Pure & Simple Make Header Stick to Top of Page with Menu Reply To: Make Header Stick to Top of Page with Menu

#22610
Sushil Adhikari
Moderator

Hi there,

Yes of course that is possible but you need to be technically sound on wordpress [Knowledge on jquery and php].
Here we are providing you the guideline that may help you.

Wrap the logo section and menu section with same div tag with provide certain id or class. After this you need to customize puresimple_customizer_js.php [Go to theme folder ->inc->uresimple_customizer_js.php]. There you will find this following code:

if (active == 1) {
				$(window).scroll(function() {
				if ($(window).scrollTop() > scroll_number) {
            		navigation_scrolling();
      			}
				else {
            		$(".navigation").css({"position":"relative"});
		 		}
   			});
	
			function navigation_scrolling () {
            	 $(".navigation ").css({"position":"fixed", "right":"0px", "left":"0px", "top": "0px","z-index":"9999"});
			}

And provide the id or class of newly created div on the above selector function. This may looks like

if (active == 1) {
				$(window).scroll(function() {
				if ($(window).scrollTop() > scroll_number) {
            		navigation_scrolling();
      			}
				else {
            		$(".class or #id of newly created div tag").css({"position":"relative"});
		 		}
   			});
	
			function navigation_scrolling () {
            	 $(".class or #id of newly created div tag").css({"position":"fixed", "right":"0px", "left":"0px", "top": "0px","z-index":"9999"});
			}

Note: If you are not technically sound on wordpress please take a help from a developer.
Be sure you are doing customization on child theme .So your changes will not lost on theme update.

Thanks