Floating Banner – Top
add_action(‘wp_body_open’, function() { ?> Please note we have a new announcement here – Thank you !!Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_action(‘wp_body_open’, function() { ?> Please note we have a new announcement here – Thank you !!Continue reading
add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading
/* Disable WordPress Admin Bar for all users */ add_filter( ‘show_admin_bar’, ‘__return_false’ );Continue reading
// Custom Login Message function custom_login_message($message) { if (empty($message)){ return “ Please enter your Id and Password below to login to the TN CLES Website, Thank You “; } else { return $message; } } add_filter(‘login_message’, ‘custom_login_message’); // Custom Logo…Continue reading
add_action( ‘init’, function() { if ( ! current_user_can( ‘manage_options’ ) && ! is_admin() && ! is_login() ) { wp_die( ‘This website is currently undergoing scheduled maintenance. Please try again later.’ ); } } );Continue reading
// Add duplicate button to post/page list of actions. add_filter( ‘post_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); add_filter( ‘page_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); // Let’s make sure the function doesn’t already exist. if ( ! function_exists( ‘wpcode_snippet_duplicate_post_link’ ) ) { /** *…Continue reading
/** * Hide Price & Add to Cart for Non Logged in Users for Specific Products */ function is_non_purchasable_products_for_visitors( $product ) { $not_purchasable_products = array( 23, 22 ); // Replace with Products ID you want to set as non purchasable…Continue reading
/* * Create a unique_id Smart Tag and assign it to each form submission. * * @link https://wpforms.com/developers/how-to-create-a-unique-id-for-each-form-entry/ */ // Generate Unique ID Smart Tag for WPForms function wpf_dev_register_smarttag( $tags ) { // Key is the tag, item is the…Continue reading
/* ===================================================== WCV Vendors Login Form – Custom Styling This CSS snippet customizes the vendor registration form to improve layout, typography, colors, and button style ===================================================== */ /* Customise vendor login fields */ form#wcv-login-form .wcv-field-wrapper>input { width: 60%; height: 48px;…Continue reading
// Show last modified date of a file function show_file_modified_date( $atts ) { $atts = shortcode_atts( array( ‘file’ => ”, // Example: ‘wp-content/uploads/data.json’ ‘format’ => ‘F j, Y g:i a’ // Optional date format ), $atts ); if ( empty(…Continue reading