Disable The WP Admin Bar
/* Disable WordPress Admin Bar for all users */ add_filter( ‘show_admin_bar’, ‘__return_false’ );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
/* Disable WordPress Admin Bar for all users */ add_filter( ‘show_admin_bar’, ‘__return_false’ );Continue reading
add_filter( ‘admin_footer_text’, function ( $footer_text ) { // Edit the line below to customize the footer text. $footer_text = ‘Powered by WordPress | WordPress Tutorials: WPBeginner‘; return $footer_text; } );Continue reading
/** * Add the post thumbnail, if available, before the content in feeds. * * @param string $content The post content. * * @return string */ function wpcode_snippet_rss_post_thumbnail( $content ) { global $post; if ( has_post_thumbnail( $post->ID ) ) {…Continue reading
add_filter( ‘login_errors’, function ( $error ) { // Edit the line below to customize the message. return ‘Something is wrong!’; } );Continue reading
remove_filter( ‘authenticate’, ‘wp_authenticate_email_password’, 20 );Continue reading
// Prevent search queries. add_action( ‘parse_query’, function ( $query, $error = true ) { if ( is_search() && ! is_admin() ) { $query->is_search = false; $query->query_vars[‘s’] = false; $query->query[‘s’] = false; if ( true === $error ) { $query->is_404 =…Continue reading
function wpcode_snippet_publish_later_on_feed( $where ) { global $wpdb; if ( is_feed() ) { // Timestamp in WP-format. $now = gmdate( ‘Y-m-d H:i:s’ ); // Number of unit to wait $wait = ’10’; // integer. // Choose time unit. $unit = ‘MINUTE’;…Continue reading
function wpcode_snippets_change_read_more( $read_more, $read_more_text ) { // Edit the line below to add your own “Read More” text. $custom_text = ‘Read the whole post’; $read_more = str_replace( $read_more_text, $custom_text, $read_more ); return $read_more; } add_filter( ‘the_content_more_link’, ‘wpcode_snippets_change_read_more’, 15, 2 );Continue reading
add_filter( ‘excerpt_length’, function ( $length ) { // Number of words to display in the excerpt. return 40; }, 500 );Continue reading
add_action( ‘admin_init’, function () { remove_action( ‘welcome_panel’, ‘wp_welcome_panel’ ); } );Continue reading