Actually found a solution and was so much easier than expected, if anyone else needs this…
add_filter('acf/fields/post_object/result', 'my_post_object_result', 10, 4);
function my_post_object_result( $text, $post, $field, $post_id ) {
/* Get whatever value you want here e.g. */
$text .= ' (' . tribe_get_venue($post->ID) . ')';
/* do any other processing you might want to do before returning it... */
return $text;
}
Hi Daniel.
That was code I found on ACF for generating a dynamic select field from repeater values.
I’ve solved it thanks, on the post template I have a repeater field to check rows that then checks if the label == the same as the name sub field, and if so, shows the additional sub fields.
Solved this by referencing another support ticket…
Thanks
Aaron
Thank you John, it worked perfectly!!
Have a fantastic weekend.
Hi John.
It’s a date picker.
Thanks for the example, will give it a go now!
Thank you.
Aaron
Great, thanks Jay, will check them out.
The rules are changing by the client, they may want each of the 10 questions on separate pages so you progress through the questions then see the results to the answers on the 11th page.
This may be the killer that stops me being able to use ACF, which would be a shame.
But thanks anyway, can use the front end form for other cool stuff.
Aaron
Spoke too soon…
Whilst I can now display the custom field in the categories page, I’m not sure how to implement the “if” statement.
Thanks
Aaron
Sorry, as soon as I posted this I figured it out!
This is the code I used…
<?php
$queried_object = get_queried_object();
$taxonomy = $queried_object->taxonomy;
$term_id = $queried_object->term_id;
the_field(‘previous_issue_link’, $taxonomy . ‘_’ . $term_id);
?>
Incase it helps anyone else in the future 🙂
Thanks
Aaron
I think I’ve solved my own problem…
I simply set up a new ACF that only displays if it’s in the videos category, and then I put the html inside the default value.
I have to go back and resave all my videos posts to include the new custom field, but it works, and it’s automated for future posts.
Hope someone finds this useful.
Amazing plugin. EVERY site I create, ACF is the first I add!!
<a href="<?php the_field('look_1_shop_now_link'); ?>" target="_blank">SHOP NOW</a>
okay, must have been the coffee but I’ve figured it out and thought to post her to share with anyone with the same need.
I’ve wrapped the custom field php into a href link code…
Simple, and works!
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.