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
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
/** * 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
// 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
// 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
add_action( ‘login_footer’, function () { remove_action( ‘login_footer’, ‘wp_shake_js’, 12 ); } );Continue reading
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
// 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
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
add_filter( ‘login_head’, function () { // Update the line below with the URL to your own logo. // Adjust the Width & Height accordingly. $custom_logo = ‘https://wpcode.com/wp-admin/images/wordpress-logo.svg’; $logo_width = 84; $logo_height = 84; printf( ‘ ‘, $custom_logo, $logo_width, $logo_height );…Continue reading
add_filter( ‘sanitize_file_name’, ‘mb_strtolower’ );Continue reading
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