Importing hard coded custom field into acf field

First off, you should know that get_post_meta() doesn’t create any custom fields (or metadata), it only retrieves the custom field’s value. But the WordPress functions that do create custom fields (for posts) are add_post_meta() and update_post_meta(). So that get_post_meta($post->ID, “mt_post_subtitle”, true) simply retrieves the value of the meta/field named mt_post_subtitle for the post (referenced by … Read more

ACF Date Based wp_query

I’ve modified your existing code.Can you please try the code bellow: $args = array ( ‘post_type’ => ‘exhibitions’, ‘meta_query’=> array( ‘relation’ => ‘AND’, array( ‘key’ => ‘exhibition_status’, ‘value’ => ‘past’, ), array( ‘key’ => ‘end_date’, ‘compare’ => ‘EXISTS’, ‘type’ => ‘DATE’ ), ), ‘meta_key’ => ‘end_date’, ‘orderby’ => ‘meta_value’, ‘order’ => ‘ASC’, ‘post_status’ => ‘publish’, … Read more

How to change post featured image using a custom field of category?

You could filter the the_post_thumbnail() function, which will dynamically show the assigned category image across all your custom post type, rather than using acf_save_post to save the category image in the post featured image meta field. By filtering the the_post_thumbnail() for your specific post type, this means if you change the image on category in … Read more

ACF Custom validation message not showing up

Add this snippet and check according to your needed. add_action(‘acf/validate_save_post’, ‘my_acf_validate_save_post’); function my_acf_validate_save_post() { $start = $_POST[‘acf’][‘field_5fb0e816ea4fc’]; //$start = new DateTime($start); $start = strtotime($start); $end = $_POST[‘acf’][‘field_5fb0e83aea4fd’]; //$end = new DateTime($end); $end = strtotime($end); if( current_user_can(‘manage_options’) ) { acf_reset_validation_errors(); } // check custom $_POST data if ($start > $end ) { acf_add_validation_error($_POST[‘acf’][‘field-600e609de8ab8’], ‘End Date should … Read more

Trouble With Conditional Logic in PHP

Did you tried dumping the value of $carousel_image For image field to return Array, return_type must be set to array https://www.advancedcustomfields.com/resources/register-fields-via-php/#field-type%20settings /* (string) Specify the type of value returned by get_field(). Defaults to ‘array’. Choices of ‘array’ (Image Array), ‘url’ (Image URL) or ‘id’ (Image ID) */ ‘return_format’ => ‘array’, Also what’s the use of … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)