wbxpress

  • Old permalink: https://wbxpress.net/2011/03/a-long-post-url.html

    New permalink: https://wbxpress.net/a-long-post-url/

    Add the following into the virtual host configuration file.

    rewrite "/([0-9]{4})/([0-9]{2})/(.*).html" https://wbxpress.net/$3 permanent;
  • To find all .ico files in the current directory and sub-directory in recursive manner:-

    sudo find . -name "*.ico" -type f

    It will display the result on the screen. Then run the following command to delete:

    sudo find . -name "*.ico" -type f -delete
  • To add description meta tag add the following code:-

  • Hide Content from Users not Logged In

    ·

    Add this code inside functions.php

    Then use the shortcode [member]Content to Hide[/member] to hide content.

  • Add this code inside functions.php of the theme file. browse the site once. and delete the code again.

    global $wpdb;
    $wpdb->query( "
        DELETE FROM $wpdb->postmeta 
        WHERE meta_key = '_thumbnail_id'
    " );
    
  • Simple add this into functions.php

    /* Remove unnecessary items from Dashboard */
    function remove_dashboard_meta() {
    remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
    remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );
    remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
    remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' );
    }
    add_action( 'admin_init', 'remove_dashboard_meta' );
    
    /* Removes some menus by page. */
    function wpdocs_remove_menus(){
    	remove_menu_page( 'edit-comments.php' );
    //	remove_menu_page( 'tools.php' );
    }
    add_action( 'admin_menu', 'wpdocs_remove_menus' );
    
    // hide admin bar wordpress logo
    function admin_bar_logo_remove() {
            global $wp_admin_bar;
            /* Remove their stuff */
            $wp_admin_bar->remove_menu('wp-logo');
    }
    add_action('wp_before_admin_bar_render', 'admin_bar_logo_remove', 0);