Link Featured Image to Post

/** * Wrap the thumbnail in a link to the post. * Only use this if your theme doesn’t already wrap thumbnails in a link. * * @param string $html The thumbnail HTML to wrap in an anchor. * @param…Continue reading

Tyler Hall Tech Custom Snippets (copy)

// Custom PHP Code by Tyler (TITLE) function page_title_sc( ){ return get_the_title(); } add_shortcode( ‘page_title’, ‘page_title_sc’ ); // Enable Shortcode Execution in Text Widgets add_filter( ‘widget_text’, ‘do_shortcode’ ); // Disable Gutenberg Editor (use Classic Editor) add_filter(‘gutenberg_can_edit_post’, ‘__return_false’, 5); add_filter(‘use_block_editor_for_post’, ‘__return_false’,…Continue reading

Tyler Hall Tech Custom Snippets

// Custom PHP Code by Tyler (TITLE) function page_title_sc( ){ return get_the_title(); } add_shortcode( ‘page_title’, ‘page_title_sc’ ); // Enable Shortcode Execution in Text Widgets add_filter( ‘widget_text’, ‘do_shortcode’ ); // Disable Gutenberg Editor (use Classic Editor) add_filter(‘gutenberg_can_edit_post’, ‘__return_false’, 5); add_filter(‘use_block_editor_for_post’, ‘__return_false’,…Continue reading

Disable Comment Form Website URL

add_filter( ‘comment_form_default_fields’, function ($fields) { if ( isset( $fields[‘url’] ) ) { unset( $fields[‘url’] ); } if ( isset( $fields[‘cookies’] ) ) { // Remove the website mention from the cookies checkbox label. $fields[‘cookies’] = str_replace(‘name, email, and website’, ‘name…Continue reading

Change Outgoing Email Sender

// Please edit the address and name below before activating this snippet. // Change the From address. add_filter( ‘wp_mail_from’, function ( $original_email_address ) { return ‘[email protected]’; } ); // Change the From name. add_filter( ‘wp_mail_from_name’, function ( $original_email_from ) {…Continue reading

Disable New User Notifications

function wpcode_send_new_user_notifications( $user_id, $notify = ‘user’ ) { if ( empty( $notify ) || ‘admin’ === $notify ) { return; } elseif ( ‘both’ === $notify ) { // Send new users the email but not the admin. $notify =…Continue reading

Disable Self Pingbacks

add_action( ‘pre_ping’, function( &$links ) { $home = get_option( ‘home’ ); foreach ( $links as $l => $link ) { if ( 0 === strpos( $link, $home ) ) { unset( $links[ $l ] ); } } } );Continue reading