Home › Forums › Backend Issues (wp-admin) › Link related to button not applying
Hello,
For a short presentation : I’m new here and I’m overall new in the development world (currently in coop work and learning WordPress development).
I have an issue with a business website using ACF PRO : the agency that designed the website seems to have used ACF to create custom fields for backoffice page editing, one of those being a “block” including a thumbnail field, a title field, a content field (text), a button field and a link field sorting every pages or posts existing on the website and linking the button to the selected page/post.
My issue being : when I select a page/post and save the edit, it doesn’t work. In the inspect console it shows that the href is empty and the button thus redirects to the ongoing page.
I’ve tried looking into the theme files and the plugin files and I found the following code in “My_Theme > content-flexible.php” of the theme files. It seems to correspond to the block previously seen when editing the page in the admin backoffice and is indeed using ACF functions “get_sub_field” and “the_sub_field” :
If I replace <a href="<?php the_sub_field('lien'); ?>"
with the direct url of the “Contact” page in the href, then the button does indeed redirects to the Contact page. But it’s obviously not what I want, as I don’t benefit from the field at all and it forces me to go in the theme files in order to simply edit the link… (+ all issues going with updates and so on).
All I want is to fix the actions of selecting a page in the link field and actually applying it to the related button. But I’m so lost as to where to do so…
I appreciate any help and I’m available on Discord (or others) to do a screen share if needed.
OKAY ! CANCEL !
I let the topic here just for information, but my problem has been solved !
It was just a bug in the Field Group.
I’ve simply edit the field group and save without any change and it solved it : now the page I select is actually applied to the link of the button.
So much time grabbing my head for this xD I’ll remember to always edit/save every single dependence now
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.