Unfortunately, what you need is someone that’s experienced with divi. I can only guess that there is some filter in the theme that is interfering with the way the value is returned. You need to track down that filter and maybe remove it or if you can’t do that then format the day yourself:
date('F j, Y H:ia', strtotime(get_field('date_field'));
Glad you got this worked out. For others that are looking for something similar. You can’t depend on the existence or absence of data in conditional fields. ACF does not remove data from the database when a field is hidden by conditional logic and like the OP says, you need to base your display of the values on the same field that the conditional logic uses.
You can set the width of a field in “Wrapper Attributes”. You can also five your fields custom classes and then create custom CSS to alter the layout.
If ACF is returning NULL for a field it means that the field in not set, there’s nothing in the database.
There isn’t enough information to help more than that. My best guess is that you’re somehow using the wrong field name. How is the field set up? Is it a sub field of a repeater or a top level field?
The plugin you mentioned is from a different developer than ACF. The beset place to get help with this will be from their support forum https://wordpress.org/support/plugin/advanced-custom-fields-table-field
There’s not enough information here.
When and where to you want to delete the repeater rows? Do you want to code this some how, on the admin page when you’re editing the page or something else?
<?php
$sidebar = get_field('sidebar'); // or whatever your field is named
if (is_active_sidebar($sidebar)) {
dynamic_sidebar($sidebar);
}
?>
you should take a look at this https://codex.wordpress.org/Function_Reference/dynamic_sidebar. There are many ways to code the sidebar and you may need additional html code. I’d suggest looking at some of the 20XX themes to see how they do it.
No, there isn’t. You will need to use a buffer as explained by the author of the framework you using.
First is that the_field()
echos the field, that’s not what you want. You need to use get_field()
. Then you need to get the path to the actual file. ACF only stores the attachment ID and will return what you set it to return. You need to take what is returned and then get the actual full file path to the file and use this file path to add it to the .zip file, like the code in the example your following does.
This has been requested, but it’s not something that is very likely to happen because it is not something that the developer of ACF is focused on. There are some plugins for custom fields that attempt to provide front end building in the admin, but they still require coding in one form or another as far as I can tell. Types & Views from https://wp-types.com/ and Pods https://wordpress.org/plugins/pods/ are a couple of examples. ACF is basically designed for coders.
I guess the answer to that is it depends on how much work you want to do.
You would need to add custom JavaScript. In this JS you would need to detect that the gallery has changed, as it happens I’ve been working doing just that for a project that I’m working on. I can give you some ideas for what’s involved, but I can give you details on the exact code to get it done.
To trigger the change event you need to target all of the hidden fields in the gallery. For jQuery the selector looks like
$('[data-key="field_589f92d2d394a"] input[type="hidden"]')
where data-key
is the field key of your gallery field.
I can share some of my code with you, basically it is written in the same style as this JS from one of my dynamic field examples.
My event is this
'change [data-key="field_589f92d2d394a"] input[type="hidden"]': '_get_set_change_gallery',
and this is the function I have so far
_get_set_change_gallery: function(e) {
// we use a timeout here because if several images are added all at once
// then this function will be triggered several times
// we can avoid runing this multiple times by using a timeout
// we also want to set a timeout like with images to give them time to load
if (window.gallery_change_timeout) {
clearTimeout(window.gallery_change_timeout);
}
window.gallery_change_timeout = setTimeout(function() {
clearTimeout(window.gallery_change_timeout);
window.gallery_change_timeout = null;
// ****************************************
// code to do what you want here
// ****************************************
}, 200);
},
Your next step for what you wan to do you need to put where it says code to do what you want here
.
What you want to do is find the sort select field, change the value of that field and then trigger the change event on that field.
Not sure if that helps you get to where you want to go.
I was able to reproduce this, but only if there is a true/false field as the first field in the second tab with tabs left aligned.
Please open a new support ticket https://support.advancedcustomfields.com/new-ticket/ and reference this topic.
Attached is a minimalist field group that duplicates the problem
I can look at your field group if you attach the json here. You’ll need to put it in a .zip to attach it.
I asked because that’s the version that I’m using. No, I see it the way it’s supposed to be shown and I’m not seeing any issues in the layout.
I’ve set up a field group that looks similar to yours, but I don’t see this. What I get is your 5.5.5 shot.
Is it still happening in 5.5.7?
Does this wc hook wc_memberships_before_my_memberships pass any values to your action, like the user’s ID?
In order to get a field from a user you need to provide the correct ID. The correct ID is "user_{$user_id)"
see the Get a value from different objects section of https://www.advancedcustomfields.com/resources/get_field/
No problem, I managed to learn something as well, that a filter I thought should work will not when using load and set terms, which is something that I do quite often.
The last parameter is the number of parameters that WP sends to your filter.
There are only a couple of reasons the filter wouldn’t be running. Either you have the wrong field key or the code is in the wrong place. What file did you put it in?
I would say that you’ll need to go about setting the default value differently in this case. You’re using a custom taxonomy, so that should make things a bit less difficult since your not dealing with “Uncategorized”
Rather than using acf/load_field in this case you should use acf/load_value https://www.advancedcustomfields.com/resources/acfload_value/ with a priority > 10
Going to be honest, I’m not exactly sure what needs to be done, this is a bit of a guess.
add_filter('acf/load_value/key=field_58086a9b13be5', 'kiteboat_set_tax_default', 20, 3);
function kiteboat_set_tax_default( $value, $post_id, $field ) {
if ($value === false && get_post_status($post_id) == 'auto-draft') {
$value = 304;
}
return $value;
}
I think I recreated it. Do you have Load Terms set to yes?
Are you trying to add a default value to a field on a post that was previously save without a value?
If this is an exiting post, does it do the same thing when you add a new post?
What version of ACF are you using?
This has been reported to the developer.
K, I get it now. Sometimes it takes me a while but I’ll get there.
Would have helped me to understand if you’d said something like, I can add content before but I can’t add it after. You may have understood what you meant, but I did not. I read it as “I can’t add content using acf/render_field. I can only add content for specific field types.”
Yes, I did. I have many fields and field groups on a test site. I added the code exactly as I posted it to the functions.php file on the test site and that content <p>This is a Test</p>
appeared before every field on the site.
Yes, you would need to create a unique filter for each field. Of you can make the decision base on the field.
You can run your filter on every field, or a specific field as explained in the document I linked to above.
ACF passes the current field values to your function in $field
function set_my_field_label($field) {
This will have the field name, field key, and all the other information about the field. If you want to see what you have to work with add
echo '<pre>'; print_r($field); echo '</pre>';
to the top of your filter, I think this is also explained in the documentation. This will output all of the field values. You can then base what field you get from the options page on one of the field values, like the name.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.