# Add vendor name to the message button label

**URL:** <https://community.hivepress.io/t/add-vendor-name-to-the-message-button-label/15932>\
**Category:** Messages\
**Tags:** code\
**Created:** [May 22, 2025, 8:51pm UTC](https://community.hivepress.io/t/add-vendor-name-to-the-message-button-label/15932 "2025-05-22T20:51:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisB](https://community.hivepress.io/user_avatar/community.hivepress.io/chrisb/32/14185_2.png) [@ChrisB](https://community.hivepress.io/u/ChrisB)\
**Post date:** [May 22, 2025, 8:51pm UTC](https://community.hivepress.io/t/add-vendor-name-to-the-message-button-label/15932/1 "2025-05-22T20:51:14Z")

</div>

Hey,

Someone else recently asked about [changing the ‘Reply to Listing’ text](https://community.hivepress.io/t/cannot-find-reply-to-listing-in-loco-translate/15900) label that’s shown on the listing pages, which I helped resolve. However, it got me thinking of alternatives and I wondered if HivePress/Loco Translate allows us to use a variable label.

So, for example:

Listing A by ChrisB shows a button with “Message ChrisB”

Listing B by @ihor shows a button with “Message Ihor”

And, so on.

(If not, would this be possible with snippets to apply to the relevant profile and listing page buttons?)

Cheers,  
Chris ✌

---

<div class="post-metadata">

**Author:** ![ihor](https://community.hivepress.io/user_avatar/community.hivepress.io/ihor/32/5_2.png) [@ihor](https://community.hivepress.io/u/ihor)\
**Post date:** [May 27, 2025, 2:45pm UTC](https://community.hivepress.io/t/add-vendor-name-to-the-message-button-label/15932/3 "2025-05-27T14:45:45Z")

</div>

Hi,

Sorry for the delay,

It’s possible if you override this template part using a child theme [hivepress-messages/templates/listing/view/page/message-send-link.php at master · hivepress/hivepress-messages · GitHub](https://github.com/hivepress/hivepress-messages/blob/master/templates/listing/view/page/message-send-link.php) You can add the vendor name `$listing->get_vendor__name()` to the button label there.

Hope this helps

---

<div class="post-metadata">

**Author:** ![ChrisB](https://community.hivepress.io/user_avatar/community.hivepress.io/chrisb/32/14185_2.png) [@ChrisB](https://community.hivepress.io/u/ChrisB)\
**Post date:** [June 18, 2025, 11:59am UTC](https://community.hivepress.io/t/add-vendor-name-to-the-message-button-label/15932/5 "2025-06-18T11:59:30Z")

</div>

Hey,

Sorry to bump this topic again. I’m finally getting around to trying this out, but the button label doesn’t seem to be updating.

I tried copying the `message-send-link.php` file to both `public_html > wp-content > themes > listinghive-child > hivepress-messages > listing > view > page` and  
`public_html > wp-content > themes > listinghive-child > hivepress-messages > templates > listing > view > page` but neither attempt seem to be taking priority after making changes.

I’m using AI to try and piece things together and I’ve tried few suggestions:

```auto
<?php
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
<button type="button" class="hp-listing __action hp-listing__ action--message button button--large button--primary alt" data-component="link" data-url="#<?php if ( is_user_logged_in() ) : ?>message_send_modal_<?php echo esc_attr( $listing->get_id() ); else : ?>user_login_modal<?php endif; ?>"><?php echo esc_html( 'Message ' . $listing->get_vendor__name() ); ?></button>

```

```auto
<?php
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
<button type="button" class="hp-listing __action hp-listing__ action--message button button--large button--primary alt" data-component="link" data-url="#<?php if ( is_user_logged_in() ) : ?>message_send_modal_<?php echo esc_attr( $listing->get_id() ); else : ?>user_login_modal<?php endif; ?>">
    <?php 
    $vendor_name = $listing->get_vendor__name();
    echo esc_html( sprintf( 
        /* translators: %s: Vendor name. */
        __( 'Message %s', 'hivepress' ), 
        $vendor_name ? $vendor_name : hivepress()->translator->get_string( 'reply_to_listing' ) 
    ) ); 
    ?>
</button>

```

```auto
<?php
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
<button type="button" class="hp-listing __action hp-listing__ action--message button button--large button--primary alt" data-component="link" data-url="#<?php if ( is_user_logged_in() ) : ?>message_send_modal_<?php echo esc_attr( $listing->get_id() ); else : ?>user_login_modal<?php endif; ?>">
    <?php 
    $vendor_name = $listing->get_vendor__name();
    echo esc_html( $vendor_name ? 'Message ' . $vendor_name : hivepress()->translator->get_string( 'reply_to_listing' ) ); 
    ?>
</button>

```

But, sadly, none of them appear to be working as expected. It would be much appreciated if you’re able to test this on your end/point me in the right direction.

Cheers,  
Chris ✌

---

<div class="post-metadata">

**Author:** ![ihor](https://community.hivepress.io/user_avatar/community.hivepress.io/ihor/32/5_2.png) [@ihor](https://community.hivepress.io/u/ihor)\
**Post date:** [June 19, 2025, 3:06pm UTC](https://community.hivepress.io/t/add-vendor-name-to-the-message-button-label/15932/7 "2025-06-19T15:06:28Z")

</div>

Please try using `listinghive-child/hivepress/listing/view/page/message-send-link.php` path instead (the sub-folder is always “hivepress” regardless of the extension), it should start overriding the default template part then.

---

<div class="post-metadata">

**Author:** ![ChrisB](https://community.hivepress.io/user_avatar/community.hivepress.io/chrisb/32/14185_2.png) [@ChrisB](https://community.hivepress.io/u/ChrisB)\
**Post date:** [June 19, 2025, 3:37pm UTC](https://community.hivepress.io/t/add-vendor-name-to-the-message-button-label/15932/8 "2025-06-19T15:37:25Z")

</div>

Ahhh! okay, thank you for clarifying that. I’ll test this out later!

---

<div class="post-metadata">

**Author:** ![ChrisB](https://community.hivepress.io/user_avatar/community.hivepress.io/chrisb/32/14185_2.png) [@ChrisB](https://community.hivepress.io/u/ChrisB)\
**Post date:** [June 20, 2025, 2:18pm UTC](https://community.hivepress.io/t/add-vendor-name-to-the-message-button-label/15932/9 "2025-06-20T14:18:19Z")

</div>

Just confirming this worked perfectly. Thanks again!

Note to self/others:

If you’d like all of the buttons with vendor/user names, you’ll need to copy over these two files, as well:

templates/vendor/view/page/message-send-link.php  
templates/user/view/page/message-send-link.php

---

<div class="post-metadata">

**Author:** ![system](https://community.hivepress.io/user_avatar/community.hivepress.io/system/32/13990_2.png) [@system](https://community.hivepress.io/u/system)\
**Post date:** [July 20, 2025, 2:18pm UTC](https://community.hivepress.io/t/add-vendor-name-to-the-message-button-label/15932/10 "2025-07-20T14:18:31Z")

</div>

Closed on July 20, 2025, 2:18pm UTC

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