0

I am trying to find where an element is generated (<div class="slicknav_menu">), this normally is easy, I just search on the theme folder for the class name (I normally use Grep for Windows and it "always" works), but I do not find it anywhere, at first I thought it may be generated by a plugin, but I disable them all and the element was still there, I changed to a default theme and it got removed, so I know it's generated by the theme but I am not able to find where is it.

What do you do in similar situations?

I am not sharing links to my website or the theme since I think it's more important to know how to solve similar issues in general.

6
  • maybe just search for "slicknav_menu"
    – Ovidiu
    Commented Jul 16, 2018 at 16:58
  • That is what I search for, just the class name, nothing. Commented Jul 16, 2018 at 17:00
  • 2
    or maybe just "slicknav' which might be a general name and then _menu and other names are appended.
    – Ovidiu
    Commented Jul 16, 2018 at 17:01
  • Thanks @Ovidiu I did locate the files that contain slicknav, theme/js/jquery.slicknav.js and theme/js/scripts.js, I tried to edit them, nothing happens, I deleted them nothing happens, so I basically cannot find how it's generated. Commented Jul 17, 2018 at 14:14
  • Maybe you delete something, then refresh your browser but if cache is enabled you will not see any change.
    – Ovidiu
    Commented Jul 17, 2018 at 16:01

1 Answer 1

4

SlickNav looks to be a "Responsive Mobile Menu Plugin for jQuery". Your theme probably ships with it. It's written in JavaScript so try greping for the class name slicknav_menu in the JavaScript files included with the theme.

As an aside, another debugging tip for next time:

Most browser dev tools allow you to disable JavaScript. If you can't find something in the PHP, try disabling JS on the page and reloading. If the $thing is not there anymore, it's almost certainly due to JS.

5
  • I did locate the files that contain slicknav as Ovidiu, theme/js/jquery.slicknav.js and theme/js/scripts.js, I tried to edit them, nothing happens, I deleted nothing happens, so I basically cannot find how it's generated. Commented Jul 17, 2018 at 14:06
  • Might be cached somewhere? Have you tried disabling JS on the page? If you figured it out by now can you add an "Update:" to you're question so future googlers don't have to dig :)
    – DaveLak
    Commented Jul 21, 2018 at 0:09
  • Disabling JS remove it, it's not cached and I simply have to move on, so I just hide it with CSS and use another menu option. Commented Jul 21, 2018 at 0:40
  • Hmm, so it's definitely in the JS. Well, when you have some time you may consider looking into setting DOM breakpoints in Chrome dev tools and that may help. But at least you have a working/temp solution, good luck :)
    – DaveLak
    Commented Jul 21, 2018 at 1:10
  • Nice to know, I will check that. Commented Jul 21, 2018 at 1:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.