• Skip to primary navigation
  • Skip to main content
Daniel McClure

Daniel McClure

Entrepreneurship, Marketing, Technology, Travel & Lifestyle

  • About
  • Credentials
  • The Blog of Daniel McClure
  • Social
  • Code
  • Contact
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter

Register Theme Support for Gutenberg Wide Images

Code snippet posted to GitHub Gist by Daniel McClure.

You are here: Home » Code Snippets » #CSS » Register Theme Support for Gutenberg Wide Images

Last Updated: November 2, 2018 Leave a Comment

The following is a code snippet originally posted by Daniel McClure on GitHub as a Gist.

functions.php

“`php
style.css

“`css
/* 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;
}
“`

Original Gist


<?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' );

view raw

functions.php

hosted with ❤ by GitHub


/* 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;
}

view raw

style.css

hosted with ❤ by GitHub

Filed Under: GitHub Gist Tagged With: #CSS, #PHP, #Wordpress

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *

You can encrypt your comment so that only Daniel McClure can read it.

Daniel McClure

Work With Me

Get in touch if you’re interested in working together on your next project.

Contact Me

Creative Commons Licence

Copyright © 2025 Daniel McClure

All opinions shared through this site are that of their respective author and are not necessarily representative of the views of past/present clients, affiliate partners or businesses.
Some links include affiliate tracking for which I may earn a commission. See the Full Disclaimer Page for more information.