// Automatically link Twitter usernames (i.e. any text in the form of @username)
add_filter( 'the_content', 'typewheel_link_twitter_username' );
add_filter( 'the_excerpt', 'typewheel_link_twitter_username' );
add_filter( 'comment_text', 'typewheel_link_twitter_username' );
function typewheel_link_twitter_username( $content ) {
return preg_replace( '/([^a-zA-Z0-9-_&])@([0-9a-zA-Z_]+)/', '$1<a href="https://twitter.com/$2" target="_blank" rel="nofollow">@$2</a>', $content );
}
Suppress Hero on Pages Without Featured Image
@replace {{element_id}}
add_filter( 'generate_header_element_display', function( $display, $element_id ) {
if ( {{element_id}} === $element_id ) {
if ( ! has_post_thumbnail() )
$display = false;
}
return $display;
}, 10, 2 );
Numbered List Rows in Gravity Forms
/* Numbered List Rows in Gravity Forms */
body .gform_wrapper .gform_fields .gfield_list {
counter-reset: gf-list-counter;
}
body .gform_wrapper .gform_fields .gfield_list .gfield_list_header::before {
width: 1.5em;
content: '';
}
body .gform_wrapper .gform_fields .gfield_list .gfield_list_group::before {
width: 1.5em;
line-height: 2.25;
font-weight: bold;
counter-increment: gf-list-counter;
content: counter(gf-list-counter);
}