multisite - Homepage Menu Link Won't Function

I am fairly new to Wordpress. I have been setting up sites using a template in a multisite installation. On the home pag

I am fairly new to Wordpress. I have been setting up sites using a template in a multisite installation. On the home page, one of the links "Twin Tiers Saves" is unresponsive but it shows in the bottom left corner of the page without the "http://" necessary for navigation. The link should open a new tab but when I click it nothing happens. The link works on all other pages except the homepage. The site is here: /. Does anyone have any advice on how to get this menu item functioning correctly? Thanks in advance for your help.

I am fairly new to Wordpress. I have been setting up sites using a template in a multisite installation. On the home page, one of the links "Twin Tiers Saves" is unresponsive but it shows in the bottom left corner of the page without the "http://" necessary for navigation. The link should open a new tab but when I click it nothing happens. The link works on all other pages except the homepage. The site is here: https://capcityradio/staging/. Does anyone have any advice on how to get this menu item functioning correctly? Thanks in advance for your help.

Share Improve this question edited Jun 11, 2019 at 19:27 RiddleMeThis 3,8078 gold badges22 silver badges30 bronze badges asked Jun 11, 2019 at 15:54 Charles J. BarnettCharles J. Barnett 32 bronze badges 1
  • It is the menu link "Twin Tier Saves". I have narrowed it down to line #1985 in the jquery.js?ver=1.12.4-wp file. I am new to wordpress so any help that you can give is much appreciated. Thanks – Charles J. Barnett Commented Jun 11, 2019 at 18:46
Add a comment  | 

1 Answer 1

Reset to default 0

This function in /themes/lucid-press-child/js/custom-js.js is your problem.

function homepageNavigationClasses(){
    if(jQuery('body.home').length){
        //jQuery('#navigation a').not('.sub-menu a').click(function(event){
        jQuery('#navigation a').click(function(event){

            var clickedLink = jQuery(this).text();
            clickedLink = clickedLink.replace(/\s/g,'');


            if(!jQuery(this).parent().hasClass('page')){
                event.preventDefault();
                //console.log(clickedLink);
                jQuery('html, body').animate({
                    scrollTop: jQuery("#"+clickedLink).offset().top - 400
                }, 500);

                jQuery('#navigation li').removeClass('active-hp-section');
                jQuery(this).parent().addClass('active-hp-section');
            }   
        });
    }
}

It's looking for a ID to scroll the page too but it doesn't have one because its an external link.

You could create a child theme and re-write the function. But the following solution is probably simpler.

Go to Admin > Appearance > Customize > Menus and manually add the page class to the "CSS Classes" field. This will add the class to the list item of the link and now your link will function as normal.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745412599a4626601.html

相关推荐

  • multisite - Homepage Menu Link Won't Function

    I am fairly new to Wordpress. I have been setting up sites using a template in a multisite installation. On the home pag

    4小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信