Problem:
How to add dynamic phone number form the phone custom field type to an Elementor button?
Solution:
Elementor button does not allow the Phone custom field type. But you can follow the steps below:
- Add a button in Elementor with static content.
- Copy the HTML code that is generated in the front end for that button.
- Add an HTML widget in Elementor and paste HTML code and use the shortcode below to retrieve the dynamic content and replace it with the static content:
[types field="cellphone"]
Replace "cellphone" with the slug of your field.
A sample final HTML code:
<div class="elementor-button-wrapper elementor-align-center"> <a href="tel:[types field='telefono']" class="elementor-button-link elementor-button elementor-size-lg elementor-animation-grow" role="button"> <span class="elementor-button-content-wrapper"> <span class="elementor-button-icon elementor-align-icon-left"> <i aria-hidden="true" class="fas fa-phone-alt"> </i></span> <span class="elementor-button-text">Llamar</span> </span> </a> </div>
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
This topic contains 4 replies, has 2 voices.
Last updated by 3 years, 5 months ago.
Assisted by: Christopher Amirian.