Group/list/sort custom post type posts by date in tabs from acf datepicker field

It’s probably best to loop through your posts two times. Once to group them by year and once to print the posts. Something like this: (not tested) $formatted_posts = array(); while ( $subsQuery->have_posts() ) : $subsQuery->the_post(); $year = get_field(‘year’); // add them to formatted_posts array and group by year $formatted_posts[$year][] = $post; endwhile; foreach($formatted_posts as … Read more

Restrict days in bootstrap datepicker using checkboxes in submenu

———— EDIT -> PROBLEM SOLVED ——— MY CODE WordPress submenu/HTML code <?php add_action( ‘admin_menu’, ‘reserveringsformulier_add_submenu_gesloten’ ); function reserveringsformulier_add_submenu_gesloten() { add_submenu_page( ‘edit.php?post_type=reserveringen’, __( ‘Gesloten dagen Restaurant’, ‘Gesloten dagen’ ), __( ‘Gesloten dagen’, ‘Gesloten dagen’ ), ‘manage_options’, ‘gesloten_restaurant’, ‘gesloten_restaurant_inger_display’ ); } function gesloten_restaurant_inger_display() { function gesloten_restaurant_inger_display() { if (isset($_POST[‘submit_datum_gesloten’])) { if (isset($_POST[‘maandag’])) { update_option(‘maandag’, $_POST[‘maandag’]); $maandag = … Read more

Sort custom post type by custom datepicker instead of filtering

In meta_query, you missed the type of the field: $args = array( ‘post_type’ => ‘events’, ‘posts_per_page’ => ‘-1’, ‘meta_query’ => array( array( ‘key’ => ‘event_date_start’ , ‘compare’ => ‘>=’, ‘value’ => current_time(‘Ymd’), ‘type’ => ‘DATE’, ) ), ‘meta_key’ => ‘event_date_start’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’ );

jQuery Datepicker displays wrong language until interection with the calendar

This must have been a conflict in my site. TBH, I wasn’t able to spot the conflict, but I was able to circumvent it by setting the necessary lang strings just before datepicker’s initiation like so: $(function() { $.datepicker.regional[‘el’] = { closeText: ‘Κλείσιμο’, prevText: ‘Προηγούμενος’, nextText: ‘Επόμενος’, currentText: ‘Σήμερα’, monthNames: [‘Ιανουάριος’, ‘Φεβρουάριος’, ‘Μάρτιος’, ‘Απρίλιος’, ‘Μάιος’, … Read more

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