Auto Admin Logout

// 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

// 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

WooCommerce breadcrumb huidige pagina verbergen v1.0

/** * 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

Restrict WP Heartbeat

// Restrict WP Heartbeat / Kiri Vadivelu / 2026 add_action( ‘init’, function() { if ( ! is_admin() ) { wp_deregister_script( ‘heartbeat’ ); // Disable heartbeat in frontend } }); add_filter( ‘heartbeat_settings’, function( $settings ) { $settings[‘interval’] = 60; // Set…Continue reading

OPcache Status

add_action( ‘admin_init’, function () { if ( ! isset( $_GET[‘opcache_status’] ) || ! current_user_can( ‘manage_options’ ) ) { return; } if ( ! function_exists( ‘opcache_get_status’ ) ) { wp_die( ‘OPcache extension not available.’ ); } $s = opcache_get_status( false );…Continue reading

Google Tag Manager – ASJ (GTM-MMC5H4C)

if ( ! function_exists( ‘asj_is_editor_or_preview_request’ ) ) { /** * True for Elementor editor/preview, Gravity Forms preview, * WordPress/Customizer previews and admin requests. */ function asj_is_editor_or_preview_request() { if ( is_admin() || is_preview() || is_customize_preview() ) { return true; } //…Continue reading