Display Post Views
Track and display post views. <?php function track_post_views($post_id) { if (!is_single()) return; if (empty($post_id)) {…
Custom Post Type for Portfolio
Create a custom post type for a portfolio. <?php function create_portfolio_post_type() { register_post_type('portfolio', array( 'labels'…
Custom Admin Dashboard Welcome Panel
Add a personalized welcome message to the admin dashboard. <?php function custom_dashboard_welcome_panel() { echo '<div…
Custom Login Page Background Image
Set a custom background image for the WordPress login page. <?php function custom_login_background() { echo…
Add Custom Admin Submenu Item
Add a submenu item under an existing admin menu. <?php function add_custom_admin_submenu() { add_submenu_page( 'tools.php',…
Add Custom Admin Menu Item
Add a new top-level menu item to the WordPress admin dashboard. <?php function add_custom_admin_menu() {…
Add Custom User Meta Field
Add Custom User Meta Field. <?php function add_custom_user_meta_field($user) { ?> <h3>Custom Meta Field</h3> <table class="form-table">…
Show User Profile Picture in Admin
Display user profile picture in the admin user list. <?php function add_profile_picture_column($columns) { $columns['profile_picture'] =…
Add User Registration Date to User Profile
Add the registration date to user profiles. <?php function add_registration_date($user) { $register_date = get_the_author_meta('user_registered', $user->ID);…
Disable File Editor
Disable the theme and plugin editor. <?php define('DISALLOW_FILE_EDIT', true);