Skip to content

Instantly share code, notes, and snippets.

@danielmcclure
Created October 30, 2018 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielmcclure/eb203efa6c7ad3a519c45190b9c0194a to your computer and use it in GitHub Desktop.
Save danielmcclure/eb203efa6c7ad3a519c45190b9c0194a to your computer and use it in GitHub Desktop.
Register Theme Support for Gutenberg Wide Images
<?php
/**
* Register Theme Support for Gutenberg Wide Images
*/
function enable_wide_images() {
add_theme_support( 'align-wide' );
}
add_action( 'after_setup_theme', 'enable_wide_images' );
/* Support Full Width Elements */
.entry-content .alignfull {
margin-left : calc( -100vw / 2 + 100% / 2 );
margin-right : calc( -100vw / 2 + 100% / 2 );
max-width : 100vw;
}
/* Support Wide Align Elements */
.entry-content .alignwide {
margin-left : -100px;
margin-right : -100px;
max-width : 1024px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment