How to display user on listing card e.g.


You can use the code below to add user name and user image to listing cards php files

e.g. \wp-content\themes\vehica\templates\card\car\card_v3.php


$vehicaUser = $vehicaCurrentCar->getUser();
$vehicaUserName = $vehicaUser->getName();
$vehicaUserUrl = $vehicaUser->getUrl();
$vehicaUserImageUrl = $vehicaUser->getImageUrl();

<div style="margin: 10px 0">
<?php if (!empty($vehicaUserImageUrl)) : ?>
<a href="<?php echo esc_url($vehicaUserUrl); ?>"><img style="width:30px; border-radius:50%; margin-right:6px" src="<?php echo esc_url($vehicaUserImageUrl); ?>" alt=""></a>
<?php endif; ?>
<a href="<?php echo esc_url($vehicaUserUrl); ?>"><?php echo esc_html($vehicaUserName); ?></a>


You can add this code e.g. here:



Please add it via Child Theme. You can learn more how to use it here: How to use Child Theme? How to change files (php / css / js) and keep theme future update compatibility?