Preferred Smooth Scroll
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }Continue reading
function current_year_shortcode() { $year = date(‘Y’); return $year; } add_shortcode(‘current_year’, ‘current_year_shortcode’);Continue reading
html body div#om-{{id}}.Campaign.CampaignType–slide { right: 40px !important; bottom: 100px !important; }Continue reading
// Disable Password Reset Functionality function disable_password_reset() { return false; } add_filter(‘allow_password_reset’, ‘disable_password_reset’); // Remove “Lost Your Password?” Link function remove_lostpassword_text($text) { if ($text == ‘Lost your password?’) { $text = ”; } return $text; } add_filter(‘gettext’, ‘remove_lostpassword_text’); // Block…Continue reading
// 1. Add the ID column after the Username column function add_user_id_column($columns) { $new_columns = array(); foreach ($columns as $key => $value) { $new_columns[$key] = $value; // Insert ‘user_id’ column right after ‘username’ if ($key === ‘username’) { $new_columns[‘user_id’] =…Continue reading
// 1. Add Columns to Media Library function add_media_library_columns( $columns ) { $columns[‘media_format’] = ‘Format’; $columns[‘dimensions’] = ‘Dimensions’; $columns[‘file_size’] = ‘File Size’; return $columns; } add_filter( ‘manage_media_columns’, ‘add_media_library_columns’ ); // 2. Display Data in Columns function display_media_library_column_data( $column_name, $post_id )…Continue reading
add_filter(‘manage_posts_columns’, ‘reorder_admin_columns’); function reorder_admin_columns($columns) { $n_columns = array(); $move = ‘author’; // Column to move $before = ‘title’; // Move before this column foreach($columns as $key => $value) { if ($key == $before) { $n_columns[$move] = $move; } $n_columns[$key] =…Continue reading
class Protected_User { // Select capabilities from the default ‘Administrator’ role public function __construct() { add_filter(‘editable_roles’, array($this, ‘filter_editable_roles’)); add_filter(‘map_meta_cap’, array($this, ‘filter_map_meta_cap’), 10, 4); } // Remove ‘Administrator’ role if the current user is not a protected user public function filter_editable_roles($roles)…Continue reading
use Elementor\Controls_Manager; use Elementor\Group_Control_Background; function add_background_and_overlay_to_layout_tab($element, $args) { // === NORMAL BACKGROUND === $element->start_controls_section( ‘custom_background_layout’, [ ‘label’ => __(‘Background (Layout Tab)’, ‘textdomain’), ‘tab’ => Controls_Manager::TAB_LAYOUT, ] ); $element->add_group_control( Group_Control_Background::get_type(), [ ‘name’ => ‘custom_background’, ‘label’ => __(‘Background’, ‘textdomain’), ‘types’ => [‘classic’,…Continue reading