How to show user IDs

Hello, does each user have an ID, if so how can I display them?

Yes, each user in WordPress has a unique ID, it’s used in the code and displaying it would require code customizations. You can check these IDs in the browser address when you edit a user in WordPress/Users.

I understand, how can I display them automatically on each seller’s page?

Hi,

Unfortunately, they are not displayed in our themes by default but are stored in the WordPress database. In order to display them, it will require a custom implementation.

I understand that this is beyond the scope of technical support, but please tell me how I can do this 1. I created my own profile page and I would like the username to appear on this page after registration or login (2 years ago I managed to do this , but unfortunately I’ve already forgotten how to do it) 2. and I would like for the user’s profile photo to appear on this page after registration or login (2 years ago I managed to do this, but unfortunately I’ve already forgotten how to do it) 3. and I I would like the id to appear on this page after registration or login 4. How to change the icon of an advertised ad to the VIP text (I couldn’t find it in GITHAB)

Hi,

I’m sorry, but there is no simple snippet here, but we can provide general recommendations. If you have created a custom page and the user object is available there, you can get the username, avatar, and ID using this function get_userdata() – Function | Developer.WordPress.org. As for the featured badge icon, you can do this with a CSS snippet or by overwriting the template parts, please check this doc How to override template parts - HivePress Help Center

1 Like

Thank you very much, what would I do without you, But unfortunately, after adding a fragment on any account, only the data of the site creator himself is displayed, bro why did this happen
// Вставка php кода с помощью шорткода name profile or elementor (phone)
function wpc_elementor_shortcode( $atts ) {
$user_info = get_userdata(1);
echo ‘’ . $user_info->user_login . “\n”;
}
add_shortcode( ‘id_php_output’, ‘wpc_elementor_shortcode’);

Hi,

Sorry for the inconvenience, but customization is beyond our support scope - it includes fixing bugs and guidance about the available features Support Policy | HivePress

If customizations are required for your site, please try customizing it using the collection of code snippets Search · user:hivepress · GitHub and other developer resources, or consider hiring someone for custom work https://fvrr.co/32e7LvY

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.