andyhqtran / divi-resources

A curated list of awesome Divi resources
https://www.elegantthemes.com/gallery/divi/
GNU General Public License v3.0
223 stars 44 forks source link

Wish List #1

Closed badcat closed 8 years ago

badcat commented 8 years ago

How can we ask for Wish List / Suggestion items?

I'd love to see a way to alter the viewport meta tag to allow EDITING of User Scaling properties.

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />

thanks.

andyhqtran commented 8 years ago

@badcat Yeah, that's not a problem!


From what I can tell, this is set by WordPress itself... However, with the code module, you can set a work around for it.

<script>
  document.querySelector('meta[name="viewport"]').setAttribute("content", "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0");
</script>
badcat commented 8 years ago

So easy! I thought it was set via the theme and I was trying not to hack the core Divi theme but also didn't want/need to create a child theme just for this one change. - thanks Andy, -- Kel

andyhqtran commented 8 years ago

@badcat no problem! I know what you mean, which is why the module is so powerful! It basically serves as a "child theme" in a way since you can replace almost anything and create almost anything! The awesome part as well, is the fact that you can set it as a global module and lock it!

badcat commented 8 years ago

Doh! waitaminute... I think I'm realizing you're expecting this in the "Code Module"-- on a per page/post etc basis in the Builder? I was thinking it would be added in the Theme Options > Integration tab (Enable Header Code then.. add Code to Head)

andyhqtran commented 8 years ago

@badcat Oh yeah, I forgot about that. That would work as well!

badcat commented 8 years ago

For anyone following along - I just added as a meta tag in the head as I stated above. Not the JS. Since it comes after the default Divi metatag, the browser uses the last one it finds (Well I hope that's how it renders out :) e.g. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=yes" />

Thanks Andy for making me think 👍

andyhqtran commented 8 years ago

@badcat That's great to hear! Just like how script tags are handled and CSS selectors, the last one overrides the first! :)