Cannot get correct button link from acf group field

Hello,

I have a theme options page and there is one group field for the button. Inside is a text field and post object to select the page.

In Cornerstone for that button, I put div as looper provider and called {{dc:acf:option_field field=“button_group”}}. Inside is a button element with enabled looper consumer. In the link part I called {{dc:post:permalink}} and for the text part called {{dc:looper:field key="text}}

Text is called correctly but I cannot get the correct link for the selected page. It’s either link for the homepage or link isn’t attached to button.

What did I do wrong?

Best regards

Hello @ofirdoo,

Thanks for writing to us.

To help you with your concerns we need to check your settings, I would request please share the admin login details meanwhile I would suggest you troubleshoot a few of the common issues before we investigate your settings. Please share your details in a secure note. Please provide the following details

  • WordPress Login URL
  • Admin-level username and password
  • Exact page URL

You can find the Secure Note button at the bottom of your posts

Thanks

Hello,

I added details in the secure note.

Best regards

Hi @ofirdoo,

The {{dc:post:permalink}} will show the current page link, to get the ACF field value, you need to specify the field name as you did for the button text.

{{dc:acf:option_field field="field_name"}}

In your case, it should be {{dc:looper:field key=“odabir_stranice”}}. If that is not working, there might be some different reasons behind your issue. I would like to suggest troubleshooting the following common issue to help us to recognize the reason.

1.Theme Related Issue
2.Plugin Conflict
3.Theme Update related issue
4.Child Theme Related issue
5.CSS/JS Customization
6.Disabling Cache
7.Disabling CDN

If you discover that an issue is coming from a custom code or 3rd party plugin, kindly consult with a developer or contact the plugin author. Please note that we do not provide support for custom codes and 3rd party plugins, kindly consult with a developer or contact the plugin author.
Please note that we do not provide support for custom codes and 3rd party plugins unless you are subscribed to One service.
If none of the above helps, please copy your live site to a staging server so we can troubleshoot freely without breaking your live site.
And give us access to the secure note, including:

– WordPress Site URL & Login URL
– WordPress Admin username/password

To create a secure note, click the key icon underneath any of your posts.

Thanks

Hello again.

With {{dc:looper:field key=“odabir_stranice”}} inside the button link field, nothing happens. No a element is generated on frontend.

I was using {{dc:post:permalink}} because on another site I have the same setup. The only difference is that the button here is in the theme options page and on another site is in the Wordpress page.

Best regards

Hello,

you can close this topic. I figured out what I did wrong.

In elements structure, there should be two div elements because the footer container doesn’t have a looper option. The first div element has a key from the theme options field and also has active consumer. The second div has a looper key element from the post object, again with active consumer and then {{dc:post:permalink}} works. To show button text, again looper key from group field with depth 1.

Hey Ofir,

We’re glad that you’re able to figure it out.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.