Support » Requests and Feedback » It Should be Possible to DETECT When Hamburger Menu Used

  • I couldn’t find this information anywhere and I think WordPress should at least have a way to tell me what the magic window size is.

    At least in OceanWP on WordPress 6.1.1 using Chrome tools I discovered that the hamburger menu is used when the width of the windows is below 960px. I don’t like hard coding this number, I should be able to obtain it via an API (maybe I can but if so I didn’t find it).

    As the window size changes client side I used the following code (I gave up on showing the code as it wouldn’t paste into “inline-code” and when added bit by bit formatting was lost).

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Such things are specified in the CSS, not in WP’s code, so it’s a themeing thing. There is no API to extract info from theme CSS files.

    Thread Starter dbareis

    (@dbareis)

    I had guessed about the CSS, but 960px is still a magic number that in my opinion should be exposed somehow for PHP/Javascript code. I assume its not going to change often so my code matches for now…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘It Should be Possible to DETECT When Hamburger Menu Used’ is closed to new replies.