Menu jumping when calling it via PHP

I’m guessing this is a css loading issue. The website loads all the resources before loading the style sheet that hides your sub menus (in your case dropdowns.less). Enqueuing .less in wordpress is done a bit different than you would enque a normal css stylesheet so you should check this out.

If this is indeed the problem, a simple fix to this that should work, is copying the “display:none” rule in the main style.css:

.dropdown-menu {
display: none;
}

Let me know if this works