Hi @allankayak,
Yes, I see that your set up is not one-page navigation, but I only suggested since what you’re trying to set up is similar to one-page navigation (navigating to sections of the page), and one-page navigation is not applicable for linking from or into another page which is your current setup.
I just thought you’re trying to set up a one-page navigation since you’re linking within the page with scrolling effect. With that, you’ll really need a custom code to make it work since your existing custom codes are really old.
Please replace this existing custom code
// Correct Positioning
jQuery(document).ready(function($) {
var screenWidth = $( window ).width();
if( screenWidth < 980 ) {
var $body = $('body');
var $adminbarHeight = $('#wpadminbar').outerHeight();
var $navbarHeight = $('.x-navbar').outerHeight();
var $topbarHeight = $('.x-topbar').outerHeight();
var $logobarHeight = $('.x-logobar').outerHeight();
$('.x-nav-scrollspy li a[href^="#"]').off('click');
$('.x-nav-scrollspy li a[href^="#"]').click(function(e) {
e.preventDefault();
var $contentBand = $(this).attr('href');
$('html, body').animate({
scrollTop: $($contentBand).offset().top - $adminbarHeight - $navbarHeight - $topbarHeight - $logobarHeight + 1
}, 850, 'easeInOutExpo');
});
$body.scrollspy({
target : '.x-nav-collapse',
offset : $adminbarHeight + $navbarHeight + $topbarHeight + $logobarHeight
});
// Fixing the custom JS code for inner pages
var $navbarHeight = $('.x-navbar').outerHeight();
var $topbarHeight = $('.x-topbar').outerHeight();
var $logobarHeight = $('.x-logobar').outerHeight();
var $combineHeight = $navbarHeight + $topbarHeight + $logobarHeight;
$('.masthead.masthead-stacked').css( 'height', $combineHeight );
}
});
with this
jQuery ( function($) {
var current_offset = $('#wpadminbar').outerHeight() + $('.e11409-1.x-bar').outerHeight();
$(document).ready( function() {
scroll_animate ( $(window.location.hash).offset().top - current_offset );
} );
$(document).on('click', '.e11409-5.x-menu a[href*="#"]:not([href="#"])', function(e) {
e.stopPropagation();
scroll_animate ( $( '#' + $(this).attr('href').split("#").slice(-1)[0] ).offset().top - current_offset );
} );
function scroll_animate ( offset ) {
$('html, body').stop().animate({ scrollTop: offset }, 850 );
}
} );
Please note that this code is only applicable for your current setup, we don’t do maintenance and customization of old codes and we can’t provide further support on this snippet. But you’re free to change and enhance it according to your preference. And it should be the user’s responsibility to maintain, enhance, and fix their custom added codes
Thanks!