Multisite: Set Responsive Breakpoint via WP Admin
-
I have a network with about 90 subsites sharing a theme. I’m looking for an efficient way to allow changing the breakpoint for the header navigation on a site-by-site basis.
Objective: Display the horizontal, “tab”-style menu whenever possible (instead of the mobile menu). Site owners have control over their main menus; menu widths are sure to vary.
Option 1: Set the breakpoint in the CSS using a variable, i.e.,
@media (max-width: $custombreakpoint)
. The variable could be populated by a site option set in the admin dashboard. I could probably figure out how to do this with PHP, but I wonder if that would slow down the network server.Option 2: I could probably wire the theme to let site admins select which (additional) CSS file to load for the main navigation styles, with a select offering several CSS files which differ only by the
@media (max-width: ___)
value.Option 3 (last resort): Create several child themes which differ solely by which version of header_nav_styles.css file they load. This is the easiest to create, but the idea of confronting site admins with 6 versions of the theme is unappealing.
[I want to avoid going the Customize: Additional CSS route as it would too easy for site owners to mess up.]
Recommendations?
For the first two, I would probably make use of Advanced Custom Fields Pro, which I am already using for other site features.
- The topic ‘Multisite: Set Responsive Breakpoint via WP Admin’ is closed to new replies.