-
-
Save billerickson/1bb1b3e3a619db8939ccfb9c8ec5d92e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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