Skip to content

Instantly share code, notes, and snippets.

@drdogbot7
Last active March 15, 2021 18:05
Show Gist options
  • Save drdogbot7/26d26abc59b4131eb2d463fc5c09285f to your computer and use it in GitHub Desktop.
Save drdogbot7/26d26abc59b4131eb2d463fc5c09285f to your computer and use it in GitHub Desktop.
Register sidebar style for wordpress 'group' block.
<?php
/**
* @package LT_block_styles
* @version 0.1.0
*/
/*
Plugin Name: Lawrence Times Block Styles
Description: Register Custom Block styles for The Lawrence KS Times
Author: Jeremy Mullis
Version: 0.1.0
Author URI: https://github.com/drdogbot7/
*/
function register_block_styles()
{
register_block_style('core/group', [
'name' => 'sidebar',
'label' => __('Sidebar'),
'inline_style' =>
'@media screen and (min-width:740px) { .is-style-sidebar { float: right; width:40%; margin-left:30px; margin-bottom:30px; } }',
]);
}
add_action('after_setup_theme', 'register_block_styles');
@drdogbot7
Copy link
Author

Download file and use as plugin, or copy/paste line 14 on into your theme's functions.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment