By using Elementorforum.com’s services you agree to our Cookies Use and Data Transfer outside the EU.
We and our partners operate globally and use cookies, including for analytics, personalisation, ads and Newsletters.

  • Join the Best Wordpress and Elementor Support forum

    Provide or get advice on everything Elementor and Wordpress, ask questions, gain confirmation or just become apart of a friendly, like minded community who love Wordpress and Elementor


    Join us!

button in an ACF isn't working

C

cspgsl

New Member
I have helped someone who has lost the developer they were using and who’s site wasn’t working. They asked me to assist even though I only have little experience in WP. I am working on developing my ability.
The page that the problem is on is linkslandgolf.com/services and linkslandgolf.com/pt/servicos
I managed to move the site to another hosting provider and get it working properly, with the exception of the “Schedule a call” buttons on the pages I have referenced.
I see that the buttons are text fields within a field group. They have a CSS style attached to them which displays them as buttons, and I think I see where the style is assigned to the text fields in the theme’s style sheet for the page.
I would have thought there is a simpler way to assign the style than writing the code for it, but I haven't found that part yet due to my lack of WP experience.
My questions is, as it is supposed to be a button that opens a Calendly popup, why does it open a blank popup window and not open the link in the text field?
I did try changing it to a URL in the ACF but that didn't help.
I have worked through various tutorials for ACF but I have not been successful in finding anything that would help in this situation. Any assisstance would be greatly appreciated.
Thank you
 
Community

Community

Administrator
Staff member
THis is what I see

Screenshot 2025-02-28 at 18-57-35 Services – Paula Backs.png


Which to me, is displaying the actual link in the content, rather than it being embeded or live link, so possibly just how your ACF field or function is firing. Hard to say though without being able to play with it. But here are some referrances


Here are other Calendly popup options:


How to implement normally without ACF


Here is a brief diagnostic that might help

1. Verify the Calendly Link

  • Ensure the ACF field contains the full Calendly URL (e.g., https://calendly.com/yourusername).
  • Test the link directly in a browser tab to confirm it works outside of the button.

2. Check for Calendly Script Integration

  • Calendly requires its embed script. Search your theme’s header.php or footer.php for:

HTML:
<script src="https://assets.calendly.com/assets/external/widget.js" async></script>

  • If missing, add this script to your theme’s header or footer via the WordPress admin (Appearance > Theme Editor) or a plugin like "Insert Headers and Footers."

3. Inspect the Button HTML

  • Right-click the button and select Inspect (Browser DevTools). The link should have:
    • A valid href pointing to your Calendly URL.
    • Calendly-specific attributes like data-calendly-url or a class like calendly-popup.
  • Example correct HTML:

HTML:
<a href="#" onclick="Calendly.initPopupWidget({url: 'https://calendly.com/yourlink'}); return false;">Schedule a Call</a>

4. Update ACF Field Output

  • If using a text field in ACF, ensure the template outputs the link with proper event handling. Replace:

PHP:
<?php the_field('button_link'); ?>

with
PHP:
<a href="#" onclick="Calendly.initPopupWidget({url: '<?php echo esc_url(get_field('button_link')); ?>'}); return false;">Schedule a Call</a>

If using a URL field, use:

HTML:
<a href="#" onclick="Calendly.initPopupWidget({url: '<?php echo esc_url(get_field('button_link')); ?>'}); return false;">Schedule a Call</a>

5. Alternative: Use Calendly’s Embed Builder

  • Generate a new embed code from Calendly’s website (under Embed / Website) and replace the button with the provided snippet. This avoids dependency on ACF for the link.
 
C

cspgsl

New Member
Thank you for all of your suggestions. I really apprecuate someone jumping it. In answer to your suggestions
  • verify the link - I took it from the user's calendly account and it does lead to their calendar

  • I added the script in step 2 but that didn't have any effect

  • What I see when I inspect the button is this

    • <a class="btn btn--blue" data-bs-toggle="modal" data-bs-target="#service1">Schedule a call</a>

    • What makes the <a> "schedule a call" into a button is the css element. As it is from the ACF I cannot see any other html for it
  • I haven't been able to figure out where to Update acf field output
    • is it in the index.php or pages.php file?
  • I thought that 5 would be the most logical thing to do, but I havent been able to replace the button/text ACF with anything that allows me to insert an embed code. I deleted one of the button/text fields in ACF, but the button still shows up on the page
  • I also tried adding an image as a button with a URL attached which you can see if you click on the Corporate tax returns box. That works, but I cannot delete the text field / button so my image is the only thing remaining.

    I have been developing sites for 20 years in Joomla, but I will admit, WordPress has me feeling pretty stupid - :confused:

    Last, if you want access, I woud gladly set you up​

 
Last edited:
C

cspgsl

New Member
With your #3 suggestion, I have managed to get all "Schedule a call" buttons on the Services page for Portugese side of the site working as well as the button on the English Corporate tab as you can see at linkslandgolf.com/pt/servicos or linkslandgolf.com/services.
The other 5 buttons on the English side will not cooperate though.
The first attempt to make the changes took, but now the issue is that when I make a change to an AFC element within a page, and save it, it does not save. For instance, I cannot remove the button image I added yesterday here linkslandgolf.com/services#corpore-tab.
I save it over and over again, but when I refresh the page it is still there.
I change the AFC element for the candaly widget and it wont save either.
Any further advice?
Thanks for any thoughts.
 
Community

Community

Administrator
Staff member
With your #3 suggestion, I have managed to get all "Schedule a call" buttons on the Services page for Portugese side of the site working as well as the button on the English Corporate tab as you can see at linkslandgolf.com/pt/servicos or linkslandgolf.com/services.
The other 5 buttons on the English side will not cooperate though.
The first attempt to make the changes took, but now the issue is that when I make a change to an AFC element within a page, and save it, it does not save. For instance, I cannot remove the button image I added yesterday here linkslandgolf.com/services#corpore-tab.
I save it over and over again, but when I refresh the page it is still there.
I change the AFC element for the candaly widget and it wont save either.
Any further advice?
Thanks for any thoughts.

When you save the page, is there a little black popup at the bottom left corner saying "Server 500 errror " or similar ?

More often than not, if a page isnt saving its because there is something on the page which is causing a server error or plugin conflict
 
C

cspgsl

New Member
There is no server error message on screen.
I did launch a ticket with my hosting company and this is one of their responses
We have conducted a detailed investigation and it seems that the issue is not related to the plugin.
They also suggest that there was a problem with the page and to create a new page and copy the data over.
In the end, I decided to search the database for the entries and delete the button and updated the ACF elements that were not saving.
The strange thing (to me) with the entry for the single button I couldn't delete was that my search for the button revealed 54 records in the table for the content on that page. You can see the screenshot of the table and one of one of the records attached. The red box is where the code was for the button that I removed.
This doesn't make any sense to me - maybe it's the way WP works. Why would there be 54 entries for a single page? I am going to do a stock WP installation on another domain and see what I can learn from there.
I believe that the theme was developed from scratch as there is no way to update it like the standard themes.
The site works now as the user intended, so I have migrated it over to the live domain. However, they want changes made so it may continue to present an issue.
I am going to keep the development domian open and create the new services page there and see what happens.
Thank you for all of your suggestions.

records.jpg



page.jpg
 
Elementor Services Elementor Services

Latest posts

Latest Resources

Other Elementor Resources

elementor official
Top