Custom Excerpt Length
add_filter(‘excerpt_length’, ‘custom_excerpt_length’, 999); function custom_excerpt_length($length) { return 20; // number of words. Default is 55. }Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_filter(‘excerpt_length’, ‘custom_excerpt_length’, 999); function custom_excerpt_length($length) { return 20; // number of words. Default is 55. }Continue reading
function applyCustomStyles() { echo ‘ ‘; } add_action(‘admin_head’, ‘applyCustomStyles’);Continue reading
add_filter( ‘site_transient_update_plugins’, ‘__return_empty_array’ ); add_filter( ‘transient_update_plugins’, ‘__return_empty_array’ ); add_filter( ‘site_transient_update_themes’, ‘__return_empty_array’ ); add_filter( ‘transient_update_themes’, ‘__return_empty_array’ ); // Disable core wp updates. add_filter( ‘pre_site_transient_update_core’, function ( $object = null ) { global $wp_version; // Return an empty object to prevent extra…Continue reading
add_filter( ‘site_transient_update_plugins’, ‘__return_empty_array’ ); add_filter( ‘transient_update_plugins’, ‘__return_empty_array’ ); add_filter( ‘site_transient_update_themes’, ‘__return_empty_array’ ); add_filter( ‘transient_update_themes’, ‘__return_empty_array’ ); // Disable core wp updates. add_filter( ‘pre_site_transient_update_core’, function ( $object = null ) { global $wp_version; // Return an empty object to prevent extra…Continue reading
🌊 Flash Flood Prompt Generator Generate random flood disaster prompts with Indonesian local drama. 🌧️ General Flood🐄 Cow Swept Away🌾 Flooded Rice Fields ✨ Generate PromptContinue reading
// Disabilita i commenti solo sugli articoli (post), non sui prodotti (product) add_action(‘init’, function() { // Rimuovi il supporto ai commenti dagli articoli remove_post_type_support(‘post’, ‘comments’); }, 20); // Nasconde il modulo commenti nel frontend per sicurezza (fallback) add_filter(‘comments_open’, function($open, $post_id)…Continue reading
/** * Update the “Count” field in real-time with the quantity of repeater fields. */ function wpf_update_repeater_count() { ?>Continue reading
// Return a 404 page for author pages if accessed directly. add_action( ‘template_redirect’, function () { if ( is_author() ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } } ); // Remove the author links. add_filter( ‘author_link’, ‘__return_empty_string’, 1000…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