Not sure what the function parameter is supposed to do but in your link it should probably read
echo(getitinarylink());, i. e. you want to echo the returned result of the function call. You might not even need the
$the_link parameter in your function declaration, you only need it if you want to pass something to the function.
Wow, something in your post broke the forum layout. 😮
What about the $product_id variable? Is that necessary? If so then it’s probably also necessary on the sub fields. What happens if you do
PHP is parsed on the server; what is sent back to the browser is plain text/HTML, so you can’t inspect PHP with your browser.
Your code looks correct on first sight. What happens if you do
<?php print_r($hero); ?> after the get_field line? Does anything come up?
I have no experience with BeaverBuilder and ACF shortcodes but it sounds like you don’t want a repeater field in the first place. A repeater is for adding multiple items to a single post. It sounds like you want just one testimonial with each post, so you just need a regular text field associated with the post type.
Perhaps the guide on querying posts by custom fields is of help?
It’s not very clear what the whole set-up is. So, you have a custom post type and a custom field called “angebot_1” is shown for all posts of this post type? Or do you have 18 custom fields where each custom field is shown in one of the 18 custom post entries? This sounds overly complicated.
Please enlighten me/us.
Check out the documentation for
get_field(), specifically the section titled “Get a value from different objects”. You should be able to get the value from a field assigned to a category by passing the category ID as second parameter:
$color = get_field( 'my_field', $category->cat_id ); … echo($color);
You can’t put PHP inside a JS file unless the JS file itself is parsed as PHP, which it isn’t. The easiest way would probably be to add the JS with PHP inline to the document header, possibly using the wp_head action hook (I’m not very experienced with action hooks, that’s just what I would assume is approrpiate).
This has nothing to do with ACF,
wp_nav_menu() is a native WP function, and according to the documentation,
menu_id must be a string; however, an ID cannot have multiple comma separated values.
container must be a string consisting of the (single) element name with which you want to wrap the whole menu. What you have there doesn’t make any sense.
And also likewise
menu_class must be a string that contains class names as they would be put in the HTML, i. e. space separated, not comma separated. And these class names would be put on the
<ul> that forms the menu list, as explained in the documentation, not on any single list item or whatever else is inside.
What exactly are you trying to do?
I have no experience with TablePress but the image looks like you are adding a table within the Gutenberg editor. You can’t put plain PHP into the editor. What you need is a repeater field with the respective fields in each row, and then you would construct a table from the output.
Please don’t cross-post, you’re just wasting the time of people and clutter the forum. I’ve posted an answer at https://support.advancedcustomfields.com/forums/topic/how-to-get-taxonomies-loop-in-single-post/
This isn’t an issue that can be discussed here because it’s a third-party plugin. You should raise the question on the plugin’s support page.
That said, the field is still working alright for me, so the error must be somewhere else. Perhaps some corrupted files after an upgrade? Try re-uploading/reinstalling and see what happens. Also, look whether the error console says anything.
Oh, and I also support the feature request for a native OSM field. 🙂
According to the documentation, looping over a group field is similar to looping over a repeater field, so it should also be possible to use a foreach loop, as explained at https://www.advancedcustomfields.com/resources/repeater/
$filament->term_id; doesn’t seem to make any sense. There is no
$filament variable (you probably mean
filament_checked_values?) and before you can get a term ID you need to get the terms associated with a post.
But other than that, if your
$filament_checked_values contains an array or object, you should get a dropdown list alright.
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!
© 2022 Advanced Custom Fields.