Query a Custom Post Type using SELECT that has ACF fields to compare dates
You can output the exact SQL query generated by WP_Query using $the_final_query->request This should give you the starting point you need to customize your SQL
You can output the exact SQL query generated by WP_Query using $the_final_query->request This should give you the starting point you need to customize your SQL
I founded myself my searching: $sql = $wpdb->prepare( ” SELECT meta_value FROM {$wpdb->prefix}commentmeta INNER JOIN {$wpdb->prefix}comments ON {$wpdb->prefix}commentmeta.comment_id = {$wpdb->prefix}comments.comment_ID WHERE comment_post_ID = %d AND meta_key = ‘rating’ AND meta_value IS NOT NULL AND meta_value <> ” “, get_the_ID() ); $results = $wpdb->get_results( $sql );
Can you try this? (function($) { “use strict”; $(‘.select2’).select2(); $(document).on(‘woocommerce_variations_loaded’, function(event) { $(document).find(‘.select2’).select2(); }); })( jQuery ); Not tested. Thanks
Can you try this amendment and see if $field is returning as you expect? $field[‘choices’][] = $choice;
Load google font script based on optgroup label selected
This works: $WhoIsUser = get_users( array( ‘meta_key’ => ‘deviceid’, ‘meta_value’ => ‘45545’ ) ); This returns the whole row for that user from the users table. If you print_r it out like so: echo ‘<pre>’ echo print_r($WhoIsUser, TRUE); echo ‘</pre>’ you get: Array ( [0] => WP_User Object ( [data] => stdClass Object ( [ID] … Read more
Try this instead, combine all 3 functions into a single one, add_filter(‘cf7sg_dynamic_dropdown_custom_options’, ‘filter_options’,10,3); function filter_options($options, $field_name, $form_key){ //field ‘dynamic_select-461’ if($form_key == ‘bez-nazvu’ && $field_name == ‘dynamic_select-461’) { $options = array(); //get your terms $terms = get_the_terms( $post->ID , ‘strava’ ); if( ! empty( $terms ) && ! is_wp_error( $term_args ) ) { foreach( $terms as … Read more
This may be a terrible way to go about population of a CF7 field… However, the way I have done so in the past is to use an identifier as the default value of the field you want to populate, for example {{cf7_year}}. I would then use a mixture of PHP to query and get … Read more
I’m using the $gas example variable from your question in my answer below. Sorry for the bad formatting, I’m typing this on my mobile device. If you’re certain that $gas will always contain a post ID then the simplest solution is to just do echo ! empty($gas) ? get_the_title( $gas ) : ”; (Ternary operator … Read more
How to make a pagination with dropdown selection?