Adding a Whatsapp URL associated with listings within the social profiles widget

In order to add a custom Whatsapp URL to the listing Submission form or rather listings, you will need to carry out the following:

1. Add the following code within the functions.php file:

function custom_user_contact_methods( $user_contact ) {
$user_contact[ 'Whatsapp' ] = __( 'Whatsapp URL' );
return $user_contact;
}
add_filter( 'user_contactmethods', 'custom_user_contact_methods', 20 );

2. Within the Appearance>Customize>Additional CSS section, add the following code to load the Whatsapp icon and style it:

a.ion-social-Whatsapp:after {
content: url(https://api.iconify.design/ion-social-whatsapp-outline.svg?height=16);
vertical-align: -0.125em;
}
.social-profiles a {
display: table-caption;
}
a.ion-social-Whatsapp {
padding-top: 8px;
background-color: #41c772;
}

3. Add the Listify – Listing/Author: Social Profiles widget to the listing sidebar within the Appearance>Widgets section.

With this done, users can add a custom Whatsapp URL during the listing submission. Once a custom Whatsapp URL is added, the Whatsapp icon will be rendered within the social profile widget on the listing, from where a user can click on the icon to send a message to the custom Whatsapp URL.

Was this article helpful?

Related Articles