Yes, it should be the same.
If you update to ACF 5, the add-ons are no longer needed as they are all integrated into ACF Pro. But your sites will keep running as-is if you DON’T update to ACF 5 and just leave them all as ACF 4, but they won’t continue to get updates as that is now an outdated version.
Thanks @PandS and Elliot, I’m pretty sure the vast majority of ACF developers understand our point, which is all that matters.
I’m not the developer of this plugin, but as a developer yourself you should strive to improve your skills instead of asking other developers to simplify their work to make it easier for you.
ACF5 is not released yet, you can only sign up for a beta test phase at the moment.
WOW, I had this exact issue a few weeks ago and could not for the life of me figure it out. I was certain it was my own code that was messing it up. However, since I was not able to get ‘post_type’ to work in the html_after_fields parameter I instead used the $_POST[‘post_id’] value and then did a get_post_type(‘$_POST[‘post_id’]) to determine the type within my various functions.
I think either way works just as well, but my way moves more control to the function rather than relying on the the acf_form array to pass an extra value.
Thanks! That makes sense now. For the sake of others, this is the working conditional statement I’m using:
if ( (isset( $_POST['fields']['field_5259b4be85a66'] ) && !empty( $_POST['fields']['field_5259b4be85a66'] ))
||
(isset( $_POST['fields']['field_5259b44f99143'] ) && !empty( $_POST['fields']['field_5259b44f99143'] )) ){
Could you put all your fields into a flexible content or a repeater field? Then each iteration of the fields would be one day.
Kyle, are you using the date/time picker plugin with ACF? If so, that’s the problem. That plugin is poorly supported and doesn’t seem coded very well and I’ve often run into the exact problem you’re having when using it.
The wp_get_attachment_image() function will work if you actually put your values in the function. Currently, you have $image = wp_get_attachment_image_src( $attachment_id, $size );
but you need to have something like $image = wp_get_attachment_image_src( 39, 'name_of_size' );
. Also, your get_field function doesn’t seem correct. I would read more into the documentation about how to use get_field.
ACF doesn’t change anything on the admin menu, at least in the way you’re looking for. I would look at this plugin for that: http://wordpress.org/plugins/admin-menu-editor/
Also, if you have a custom post type set up correctly, it should automatically show up on the menu for you already. Check the settings to make sure it’s OK.
First of all, you didn’t say exactly what is not not working which makes it hard to diagnose.
Secondly, if you’re using a repeater, shouldn’t you be using get_sub_field instead of get_field?
Just a couple shots in the dark before Elliot responds.
There are multiple ways to do this. You could either create a custom taxonomy called something like “show_on_home” and then, just like a category, you would choose an option when publishing the post and the just add ‘show_on_home’ => ‘true’ to your query.
Or, if you really want to use ACF to do this, you could just use a conditional statement to hide some of them. Something like this:
if (get_field('show_on_home')) {
Put your loop here...
}
That is sort of inefficient though because your still loading the posts with the loop, and then just hiding them.
The better way to do it, although a bit more complex, is using meta_queries in your main query. I would start here to learn about those: http://codex.wordpress.org/Class_Reference/WP_Meta_Query
Thanks, that worked. And yes, it does seem like you have to manually set the field_groups, but that’s fine for my situation.
Z
Well of course I figured it out 10 minutes later. I had the acf_form_head() function to low on the page. Moved it up and all is well.
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.