Support » Fixing WordPress » Javascript function for current class

  • I ve created a text widget with links.

    I m trying to highlight the site I m currently on

    (current class).

    I wanted to achieve this by pasting the following code in my

    but it doesnt seem to work.

    any idea why ?

    <script type="text/javascript">
    $(function() {
         var pgurl = window.location.href.substr(window.location.href
         $("#custom-side ul li a").each(function(){
              if($(this).attr("href") == pgurl)
  • The topic ‘Javascript function for current class’ is closed to new replies.