WordPress Date with ACF
WordPress Date with ACF
WordPress Date with ACF
Advanced Custom Fields changes get stuck in cache
Found the answer, if anyone has problems in the future. add_filter(‘wpseo_opengraph_desc’, ‘__return_false’ );
Start by collecting all the dates of the current post (event) in the array. Then iterate throught the array and get all events for each date. // all dates from current event in format “Ymd” $all_dates = []; for ($i = 0; $i < $date_count; $i++) { // Get repeater fields $dates=”dates_times_” . $i . … Read more
ACF Wysiwyg Editor Image srcset for responsive images [closed]
So, the scattered documentation on this is really less than clear. For checking for unchecked posts added the following meta_query: ‘meta_query’ => array(array( ‘key’ => ‘external’, ‘value’ => ‘0’, ‘compare’ => ‘=’ )) For filtering by checked it was just this: meta_query => array(array( ‘key’ => ‘external’, ‘value’ => ‘0’, ‘compare’ => ‘=’ ))
Bulk-Update Custom Posts
If you want to include your own inputs on the acf_form() you should use some of its parameters to allow the form submit them. Otherwise your inputs will be out of the form. As an example you could use this code: <?php acf_form( array( ‘html_after_fields’ => ‘<input type=”text” id=”id_whatsapp” name=”acf[n_whatsapp]” value=”acf[n_whatsapp]”>’, ) ); ?> You … Read more
ACF (Advanced Custom Fields) not updating post or postmeta values
I resolved this by adding wp_query->is_main_query() to my clauses before I set the query update. Ie… // The filter code that shows only the current authors posts add_action(‘pre_get_posts’, ‘query_set_only_author’); function query_set_only_author( $wp_query ) { if( is_admin() && get_current_user_role()==”required_role” && $wp_query->is_main_query() ) { if ( basename($_SERVER[‘PHP_SELF’])==”edit.php”){ $wp_query->set( ‘author’, $current_user->ID ); } }