• Resolved Perce2

    (@perce2)


    Hi, how can you add the advert authour’s name to the contact form template?
    Have tried – {$advert.post_author}

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    by default in the [adverts_add] form, there is a “Contact Person” field, if you have not removed it then you can use it in the email template like this {$advert|meta:adverts_person}.

    If you prefer to use the display name saved in the wp-admin / Users then you would need to first register a function that will be able to do it.

    That is, first add the code below in your theme functions.php file

    
    function get_user_display_name( $user_id ) {
      return get_user_by( 'id', $user_id )->display_name;
    }
    

    then in the email template you should be able to use the following syntax {$advert.post_author|get_user_display_name}.

    Thread Starter Perce2

    (@perce2)

    Excellent, works perfectly!
    Thanks Greg

    Is there anyway to add a reset or clear button to the search form?
    Having to un-check boxes in location and category every search may put some folks off.

    Regards

    • This reply was modified 5 years, 1 month ago by Perce2.
    Thread Starter Perce2

    (@perce2)

    Please ignore my last comment , have found a solution for this.
    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Personalise contact message’ is closed to new replies.