Home › Forums › Front-end Issues › Trouble in displaying category link › Reply To: Trouble in displaying category link
For radio button fields, you’ll need to add ['value']
or ['label']
after the variable to show either the value or label:
<a href="<?php echo get_permalink( $shopid['value'] ); ?>" class="button">See</a>
For testing, you’ll want to grab the object which will include the values and labels:
<?php
$shopid_obj = get_sub_field_object( 'cat_link' );
var_dump($shopid_obj);
?>
The above will spit out the array of your radio button field so you can see what’s there.
See more here: https://www.advancedcustomfields.com/resources/radio-button/
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.