title: Uncaught TypeError: undefined is not a function (anonymous function) in Wordpress
body: <p>I am getting the following error, which appears to be Javascript not interpreting the $ symbol.</p>
  
  <p>Uncaught TypeError: undefined is not a function main.js:1
  (anonymous function) main.js:1</p>
  
  <p>Appended below is the main.js code. This was working fine sometime back. I am trying to find out pointers to where to look for the issues, i.e. theme, jquery imports, etc. Any suggestions are welcome.</p>
  
  <pre><code>$(function(){ 
  var cardHeight = 0;
  
  function _setCardHeight(){
  
      $(".subpage-box").each( function(){ var current_height = 
      $(this).height();
  
          cardHeight = ( current_height &gt; cardHeight) ? current_height : 
          cardHeight;
  
      }); $(".subpage-box").each( function(){ if( $(this).height() &lt; 
      cardHeight ){ $(this).height( cardHeight );   } });
  
  
  }
  
  function _setNavStyle(){
      $("menu-main-menu &gt; li &gt; a").each( function(){
          var text = $(this).html();
  
          if( $(this).contains("for") ){
  
          }
      });
  }
  
  _setNavStyle();
  _setCardHeight();
  
  });
  </code></pre>