I want show only data for today

Well dear thanks for your effort.I solved this .here is answer. $user1 = $wpdb->get_results(“select product,checked_by,submit_date,unit_data,temperature_in,temperature_out,time_in,category from diary_user_form_storage where category_name=”opening” and DATE(`submit_date`) = CURDATE()”);

PHP – Woocommerce 3.2 Add variable shipping insurance with multiple “else if ” conditions

Solved! I had the statements in the wrong order, the first if statement was satisfied so none of the others were checked. Reversed them and voila! I also could have added a <= to each statement //General Fall back for shipping and cart totals <= 50 $insurance_fee = 0; $chosen_methods = WC()->session->get( ‘USPS_Simple’ ); $chosen_shipping … Read more

PHP array to jQuery array ” Uncaught SyntaxError: Unexpected token < "

To change choices depending on what an user selected in another input/select, you need to use the WP AJAX API. In your functions.php, use wp_localize_script() to get AJAX url available on front-end and define an AJAX action callback function mytheme_custom_scripts() { if ( is_page(‘Support’) ) { $scriptSrc = get_stylesheet_directory_uri() . ‘/js/freshdeskdata.js’; wp_enqueue_script( ‘myhandle’, $scriptSrc , … Read more

wp_send_json erase last value

You don’t need to specify datatype in your AJAX call. Also, WP handles AJAX a bit differently, primarily: $(‘#filter_evenement’).submit(function(){ jQuery.ajax({ url:ajaxurl, type:”POST”, data : {action: “evenements_filter_function”, val1: “value1”, val2: “values2”}, success:function(data){console.log(data); var dataArray = jQuery.parseJSON(data);//parse JSON }, fail: function( jqXHR, textStatus, errorThrown ) { } }); }); data has to contain action which specifies the … Read more

Update all posts in custom post types with wp_cron()?

Yeah, you can schedule a WP cron job to loop through all posts of a post type and perform the check / add the term. Wouldn’t recommend that for a very big page with thousands of posts though. In example below the scheduled job would run approximately once a day – remember that wp cron … Read more

Calling WordPress hook from within a class: call to undefined function error

On this line: add_action(‘admin_menu’, array($this, ‘create_menu_item’)); You are correctly passing the create_menu_item method of the current class to callback argument of the add_action() function. You just need to apply the same principle for the callbacks in the add_menu_page() function: add_menu_page( $value->post_title, $value->post_title, ‘manage_options’, $value->post_name.’-admin-page.php’, array( $this, ‘create_admin_page’ ), // <– Here ‘dashicons-location-alt’, 6 ); This … Read more

CSS loading as empty file in Custom Theme

This looks like an issue of “File Permission” to me. Please check the file permissions on the involved folders and files. You should find an option to change permission on the top bar or by right-clicking in cpanel. On the other hand, you can also right-click on a folder or a file and change its … Read more