Skip to content

Instantly share code, notes, and snippets.

View davidallenlewis's full-sized avatar

David Lewis davidallenlewis

  • Halifax, NS. Canada
View GitHub Profile
/* Override Gutenbergs asymeteical column margins with the negative margin trick */
.wp-block-columns {
margin: 0 -20px;
}
.wp-block-columns .wp-block-column {
margin: 0 0 20px 0;
padding: 0 20px;
}
// *******************************
// Make Gutenberg Sidebar Wider / Fluid
// -------------------------------
function wider_gutenberg_settings_sidebar() { ?>
<style>
@media (min-width: 1080px) {
#wpwrap .edit-post-layout.is-sidebar-opened .components-notice-list {
right: 26vw !important;
}
#wpwrap .edit-post-layout.is-sidebar-opened .edit-post-plugin-sidebar__sidebar-layout,
@davidallenlewis
davidallenlewis / get_acf_field.php
Last active March 3, 2019 15:24
Get ACF Block fields outside block template
<?php
// *******************************
// Get ACF block fields outside block templates
// -------------------------------
function get_block_field( $field_id, $post_id = '' ) {
// Get current post ID if post_id arg isn't passed
$post_id = $post_id ? $post_id : get_the_ID();