Limited Support
Our team is currently on holiday, so support will be limited during this period. Response times may be slower than usual, and some inquiries may be delayed.
We appreciate your patience and understanding, and we’ll resume our usual support by the end of August.
Our website uses the comment function exclusively in the members area.
When someone makes a comment, I would like to see the full name. Often the users have abbreviations that make it difficult to immediately identify who they are. I have already tried various methods, but none of them work.
The subscriber name (or author name) should be replaced by First / Lastname.
I had the script developed, but it works.
Maybe it is much simpler.
Where can I find the code to swap the names?
Who can help?
document.addEventListener('DOMContentLoaded', function () { // Warte, bis die Seite vollständig geladen ist var commentAuthors = document.querySelectorAll('#wpdcom .wpd-comment-header .wpd-comment-author'); commentAuthors.forEach(function(authorElement) { var userId = authorElement.getAttribute('data-user-id'); // Benutzer-ID holen if (userId) { // Benutzerdaten abrufen (Vorname, Nachname) fetch('/wp-json/wp/v2/users/' + userId) .then(response => response.json()) .then(user => { var firstName = user.first_name; var lastName = user.last_name; var fullName = firstName + ' ' + lastName; // Den Kommentatorennamen ersetzen authorElement.textContent = fullName; }) .catch(error => console.error('Fehler beim Abrufen des Benutzernamens:', error)); } }); });
Hi,
You should change the "Display name publicly as" option value. The following article should help you with this: https://memberfix.rocks/change-display-name-publicly-as/