ACF Repeater and Sort
ACF Repeater and Sort
ACF Repeater and Sort
…Removed my prior ‘solutions’… So, the real problem here is that this function is hooked to publish_post action, at which point the post might not be saved yet, if it is a new post. Only if it is a post already saved but with some other status, we can access the ACF values using get_field(). … Read more
I’m assuming that $attachments_ids are the new values you want to save. $field = get_field(‘images’); $attachments_ids = [ 0 => 22222, 1 => 33333, 2 => 44444, 3 => 55555 ]; update_field($field, $attachment_ids, $post_id);
You would at least need to create one page where you can list all the info. In the php template for that page, you can then change that info based on the page you’re linking from. That would be the same link for all pages though (you could get around that with rewrite rules, but … Read more
After attempting many upgrades of various WP and ACF versions, I have concluded that WP 3.8 to 4.2 with ACF 4 data can not be upgraded to WP 4.3+ withACF 5. Reason WP 4.3 introduced a feature called split_shared_term, which affects the data used by ACF 5. ACF 4 stores the data in a manner … Read more
No it won’t. it will still be there and WPbakery will format it into one of it’s text boxes if you choose that editor on a page/post edit screen. It’s always a good idea to back your site / db up if you are concerned about it though!
Well, your problem lies in your CSS code. .card-container .main-content:hover { background: <?php the_field(‘background-farbe’ ); ?>; background-blend-mode: multiply; } It uses class only, so it will be applied to every element with that class. Multiplying the same code with different colors won’t change anything – only one such rule will be active. So how to … Read more
How to query wordpress with array of meta_values?
In order to add a new value and keep the previous values, you need to use add_post_meta() instead of update_post_meta(): $post_id = get_the_ID(); $new_post_desc=”the new value here”; // add_post_meta() add a new field with the same name // and keeps previous values on the database add_post_meta( $post_id, ‘post_desc’, $new_post_desc ); Then, you can use get_post_custom_values() … Read more
Check out the documentation for ACF image fields: https://www.advancedcustomfields.com/resources/image/ When you use get_field on an image field, it looks like it returns the ID for the image, not a URL. This might have been different in a previous version of ACF. I think something like this might work: $image = get_field(‘user_avatar’, $user->ID’); $size=”full”; // (thumbnail, … Read more