How to auto-generate random numbers in username?

This function would generate a unique user login slug: function my_unique_user_slug( $slug ) { global $wpdb; $check_sql = “SELECT user_login FROM $wpdb->users WHERE user_login = %s LIMIT 1”; if ( ! $wpdb->get_var( $wpdb->prepare( $check_sql, $slug ) ) ) { return $slug; } $suffix = 2; do { $alt_slug = $slug . $suffix; $user_slug_check = $wpdb->get_var( … Read more

Show username only if logged in in a else no directly name

this is the whole code in stoerer.php <!doctype html> <html lang=”de”> <meta charset=”utf-8″> <title> Störer</title> <head> <script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js”></script> <link rel=”stylesheet” href=”style.css” type=”text/css”> </head> <body> <header> <button>Ich bin ein Störer</button> <!– Und dann die Info-Box –> <div id=”infoBox”> <button class=”cross” type=”button”>X</button> <p> Hello </p> <?php wp_get_current_user(); ?> <p> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, … Read more

How to add logged in username after WordPress URL?

You can try this shortode in this plugin file or you can paste this method to bottom of active theme’s functions.php. If you are new to WordPress and need a help you can visit here for steps to add code in function. add_shortcode( ‘my-awesome-button’, ‘wp_my_awesome_bytton’ ); function wp_my_awesome_bytton( $atts ) { $button_html=””; if ( is_user_logged_in() … Read more