Linking three taxonomies with ACF
Linking three taxonomies with ACF
Linking three taxonomies with ACF
ACF Upload Image in repeater from front-end with custom form? – add_post_meta()
Lets break this down, Advanced Custom Fields (ACF) does save the data as custom field/post meta, I guess it seems all to obvious, but it is better to confirm it, and ElasticPress does set up custom fields automatically to include them into the search index. ElasticPress does this unless the meta data is hidden, which … Read more
There’s some contradiction between your question and the code you provided, so I’m not exactly sure which of two scenarios you’re dealing with. Scenario 1 – You want to show all Shops with a specific value for shop-id and all Restaurants with the same specific value for restaurant-id. Let’s say that value is 20. You … Read more
When using ACF you should use the methods described in their website documentation because ACF does not store data in the normal WordPress way. You can use the get_field or the_field functions to retrieve data from your fields. For example to get data for your field ‘cover_photo’ you could do: $user_id = get_query_var( ‘author’ ) … Read more
The solution you used seems correct. But if you still want to know alternatives, here it is: $varname = get_post_meta($post_id, ‘fieldname’, true); echo $varname; $varname will be an array if the last parameter is false and will be the value of metadata field if the last parameter is true. You can use the_field() as well … Read more
SOLUTION: I will post my solution and explain what was the problem and I hope that this post can help someone in the future. As we talk in the small comments the problem, was that I was sending a non existing taxonomy by error and this was causing the AND (0=1). To fix the whole … Read more
I did have the same issue. And I wasted enough time for the answer. At first be sure that: The ajax request isn’t failed and happens. So, check: Is acf_form_head() before get_header() and run before any html is output? Does your theme contain call to wp_head()? Does your theme contain call to wp_foot()? Are your … Read more
There’s no hook named post_trashed_messages, but there is the bulk_post_updated_messages hook which you can use to change the bulk action updated messages: add_filter( ‘bulk_post_updated_messages’, function ( $bulk_messages, $bulk_counts ) { $bulk_messages[‘post’][‘trashed’] = _n( ‘%s post successfully deleted.’, ‘%s posts successfully deleted.’, $bulk_counts[‘trashed’] ); return $bulk_messages; }, 10, 2 ); Or to target a specific post … Read more
I would try something like this… // Assume there is only one category. $product_category = get_the_terms($post, ‘product-category’)[0]; $cat_fields = get_fields(“term_$product_category”); $color = $cat_fields[‘category_colour_primary’]; You could also do this… // Assume there is only one category. $product_category = get_the_terms($post, ‘product-category’)[0]; $color = get_field(‘category_colour_primary’, “term_$product_category”);