Instantly share code, notes, and snippets.

@billerickson /single.php Secret
Last active Dec 19, 2018

Embed
What would you like to do?
<?php
/**
* Post Title Width
* @see https://www.billerickson.net/change-width-of-post-title-in-gutenberg/
*/
function be_single_post_title_width( $attr ) {
$custom_width = intval( get_post_meta( get_the_ID(), 'ea_post_header_width', true ) );
if( empty( $custom_width ) || 1168 == $custom_width )
return $attr;
$attr['style'] = 'max-width: ' . $custom_width . 'px';
return $attr;
}
add_filter( 'genesis_attr_entry-title', 'be_single_post_title_width' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment