Skip to content

Instantly share code, notes, and snippets.

@billerickson
Last active December 19, 2018 15:06
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 billerickson/1bb1b3e3a619db8939ccfb9c8ec5d92e to your computer and use it in GitHub Desktop.
Save billerickson/1bb1b3e3a619db8939ccfb9c8ec5d92e to your computer and use it in GitHub Desktop.
<?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