// No Index Category / Kiri Vadivelu / 2026 add_filter(‘wp_robots’, ‘no_index_category’); function no_index_category(array $robots) { // Check if the current post has ‘members’ category if (is_single() && has_category(‘members’)) { $robots[‘noindex’] = true; } return $robots; }Continue reading
// No Index Page / Kiri Vadivelu / 2026 add_filter( ‘wp_robots’, ‘no_index_page’ ); function no_index_page( $robots ) { if ( is_page() ) { $robots[‘noindex’] = true; } return $robots; }Continue reading
// Advanced Logout Redirect / Kiri Vadivelu / 2026 add_action(‘wp_logout’, ‘redirect_after_logout’); function redirect_after_logout() { wp_safe_redirect(home_url()); exit; }Continue reading
// Advanced Login Redirect / Kiri Vadivelu / 2026 function advanced_login_redirect( $redirect_to, $request, $user ) { if ( isset( $user->roles ) && is_array( $user->roles ) ) { // Role based user redirect if ( in_array( ‘member’, $user->roles ) ) {…Continue reading
// Auto Admin Logout / Kiri Vadivelu / 2026 add_filter( ‘auth_cookie_expiration’, ‘short_session_admin’, 10, 3 ); function short_session_admin( $expiration, $user_id, $remember ) { // Only apply the short timeout for administrators if ( user_can( $user_id, ‘manage_options’ ) ) { return 3600;…Continue reading
// Sticky Tag Post / Kiri Vadivelu / 2026 add_action(‘pre_get_posts’, function($query) { if (!is_admin() && $query->is_main_query() && is_tag()) { $sticky_posts = get_option(‘sticky_posts’); if (!empty($sticky_posts)) { add_filter(‘posts_orderby’, function($orderby, $query) use ($sticky_posts) { if (!is_admin() && $query->is_main_query() && is_tag()) { global $wpdb;…Continue reading
// WP Mail SMTP 4.10.0: stop the “Class ‘Normalizer’ not found” fatal on hosts without PHP intl. // Remove once the plugin update with the fix is installed, or once intl is enabled. if ( ! extension_loaded( ‘intl’ ) &&…Continue reading
/** * DVA – WooCommerce breadcrumbs * Versie 1.3 * * Doel: * * GEWONE WORDPRESS-PAGINA’S * – Huidige pagina blijft zichtbaar. * – Parent /letters-cijfers/ wordt weergegeven als: * “Letters & Cijfers” * – Parent /baby-kinderkleding/ wordt weergegeven als:…Continue reading
// Progressive Password Field / Kiri Vadivelu / 2026 add_action(‘login_enqueue_scripts’, ‘field_without_script’); function field_without_script() { echo ‘ ‘; }Continue reading
// Disable User Login / Kiri Vadivelu / 2026 function disable_user_login( $user ) { if ( is_wp_error( $user ) ) { return $user; } if ( is_a( $user, ‘WP_User’ ) ) { $disabled_user_ids = array( 10 ); // User IDs…Continue reading