How to give guest users “not logged in” a role?

You need to add to the template directly or via a short code from PHP Snippets plugin. Source: https://developer.wordpress.org/reference/functions/is_user_logged_in/ <?php if ( is_user_logged_in() ) {     echo ‘Welcome, registered user!’; } else {     echo ‘Welcome, visitor!’; } ?>

Limit 1 post by user in each custom post type

You’re using wp_count_posts( for counting posts, so it will return the number of posts. If you want to get the number of posts for given user, you should use count_user_posts instead. So change this line: $count_post = wp_count_posts($post_type_name)->publish; to: $count_post = count_user_posts( get_current_user_id(), $post_type_name, true );

wp-admin/users.php Add a column with last name

3 Steps Add custom column Fill data in custom column Make the column sortable //Add custom column function my_custom_wp_filter_add_user_lastname_column($columns) { $columns[‘user_lastname’] = ‘Last Name’; return $columns; } add_filter(‘manage_users_columns’, ‘my_custom_wp_filter_add_user_lastname_column’); //Fill in value in custom column function my_custom_wp_filter_add_user_lastname_column_value( $column_output, $column_name, $user_id ) { $user = get_userdata( $user_id ); if ( ‘user_lastname’ == $column_name ) { return … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)