jQuery datepicker not showing on admin menu
Use admin_enqueue_scripts action instead of admin_head. Then see network tab in dev tools that datepicker scripts are included. You need the include the jQuery UI CSS also, it is not included in WP core.
Use admin_enqueue_scripts action instead of admin_head. Then see network tab in dev tools that datepicker scripts are included. You need the include the jQuery UI CSS also, it is not included in WP core.
WordPress has the jQuery datepicker already included. So you can enqueue the default WP script. However, as far as I know, WP doesnt include the necessary styling for the datepicker! So try to enqueue the WP script, and for example, styles from external source: function my_datepicker_enqueue() { wp_enqueue_script( ‘jquery-ui-datepicker’ ); // enqueue datepicker from WP … Read more
There’s no native “Time Interval” field type in ACF, but you could: Use a third-party custom field like the “Date Range Picker” provided by ACF Extended (it’s a commercial plugin that adds features to ACF). Use 2 distinct native Date Picker fields for “from” and “to”, possibly inserted inside a Group. You may take advantage … Read more
Don’t include jquery from any other source, it will create conflict. Bcoz jQuery is pre bundled in wordpress by default. For your question, add an id or class to the input element then add the datepicker based on the class. For example <input type=”text” class=”da_test” value=”” > <script type=”text/javascript”> $(window).load(function() { $(‘.da_test’).glDatePicker(); }); </script> This … Read more
try now this code <?php function load_requirements() { wp_register_script(‘mdp’, ‘https://cdn.rawgit.com/dubrox/Multiple-Dates-Picker-for-jQuery-UI/master/jquery-ui.multidatespicker.js’); wp_enqueue_script(‘mdp’); } add_action(‘admin_head’, ‘load_requirements’);?> jQuery(document).ready(function($) { $(‘.datepicker’).multiDatesPicker(); });
I failed to mention that I’m using the Essential Grid plugin to make the grid elements. This plugin has the ability to use meta data from your theme or another plugin in the grid. Therefore, I’m creating a grid that’s linked to a Custom Post Type, then I’m using meta from a custom meta box … Read more
Loop the posts between two dates selected using jquery datepicker
using ACF datepicker to filter posts on a page
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
———— 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