WordPress.org

Ready to get started?Download WordPress

Forums

The Bootstrap
[resolved] JS error in theme (4 posts)

  1. ljkeashly
    Member
    Posted 7 months ago #

    Hi,

    We are using the-bootstrap and are having an issue where code is inserted into the page in the footer area by wp_footer() call which has a JS error.

    This is the code that gets inserted:

    if (jQuery("ul (li.page_item):has(ul.children)").length > 0) {
    	  jQuery("ul (li.page_item):has(ul.children)").hover(function () {
                jQuery(this).children("a").removeAttr('href');
                jQuery(this).children("a").css('cursor', 'default');
                jQuery(this).children("a").click(function () {
                  return false;
                });
              });
     	}
    	else if (jQuery("ul (li.menu-item):has(ul.sub-menu)").length > 0) {
              jQuery("ul (li.menu-item):has(ul.sub-menu)").hover(function () {
                jQuery(this).children("a").removeAttr('href');
                jQuery(this).children("a").css('cursor', 'default');
                jQuery(this).children("a").click(function () {
                  return false;
                });
              });
    	}

    If I comment out wp_footer() in footer.php, then this code goes away.

    When that code is in the template we get the following JS error:
    Error: Syntax error, unrecognized expression: ul (li.page_item):has(ul.children)

    Does anyone know why this code is being inserted, by what and where?

    Thank you.

  2. Zulfikar Nore
    Member
    Posted 7 months ago #

    That code does not seem to be from the theme.

    Have you checked your plugins? Also test the site with the default theme to see if the error stays or disappears.

    A link to the site would be of help in assisting you further if the issue persists.

  3. ljkeashly
    Member
    Posted 7 months ago #

    Hi,

    Thank you for your repsonse. It turns out it was the "Disable Parent Menu Link" plugin that was adding the code.

    Thanks again.

  4. Zulfikar Nore
    Member
    Posted 7 months ago #

    You are welcome.

    Don't forget to mark the thread as resolved.

Reply

You must log in to post.

About this Theme

About this Topic