Окно Jquery.Расположение.хэш не работает на домашней странице

#javascript #jquery #wordpress

Вопрос:

Я создаю клиентский веб-сайт и добавил вкладки прокрутки Jquery. Я настраиваю якорные ссылки для перехода из меню, чтобы вы могли перейти из меню на определенную вкладку.

Это работает со страницы вкладок. https://alphadevsite1.co/vertical-tabs

но пункты меню не нажимаются с домашней страницы https://alphadevsite1.co

Я что-то упускаю? Это и есть код:

https://codepen.io/genesis16/pen/rNjBORv

   jQuery(document).ready(function($) {
    // Code that uses jQuery's $ can follow here.
  jQuery(function() {
   $('.tabs nav a').on('click', function() {
    show_content($(this).index());
  });
 
  
  show_content(0);

  function show_content(index) {
    // Make the content visible
    $('.tabs .content.visible').removeClass('visible');
    $('.tabs .content:nth-of-type('   (index   1)   ')').addClass('visible');

    // Set the tab to selected
    $('.tabs nav a.selected').removeClass('selected');
    $('.tabs nav a:nth-of-type('   (index   1)   ')').addClass('selected');
  }
  if(window.location.hash) {
var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character
$('.tabs nav a#' hash).click();
console.log('.tabs nav a#' hash);
}
$("#menu-main-menu li a").click(function(e){
    e.preventDefault();
    var locationString = $(this).attr("href");
    var index = locationString.indexOf("#");
    if (index !== -1){
    var hash = locationString.substring(index 1)
    console.log($(this));
    $('.tabs nav a#' hash).click();
    console.log('.tabs nav a#' hash);
    }
    
    
});
});

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-36251023-1']);
  _gaq.push(['_setDomainName', 'jqueryscript.net']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www')   '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  
});
 

Любая помощь действительно ценится

Овации

Комментарии:

1. .tabs nav a# гнида там на домашней странице