Warning: in_array() null given in PHP function

Well first you have this code // no matter what the value here, you can forget about it (because in the next line of code you assing a new value to the same variable) $post_types = apply_filters( ‘sortable_wordpress_gallery_post_types’, array( ‘post’ ) ); // only this really matters $post_types = apply_filters( ‘sortable_wordpress_gallery_’ . $this->id . ‘_post_types’, … Read more

How to say if meta_value is greater than 0 in an array?

As documented, you can use meta_compare: $args = array( ‘meta_key’ => ‘userfunds’, ‘meta_value_num’ => ‘0’, ‘meta_compare’ => ‘>’, ); Note that I changed meta_value to meta_value_num. This ensures the values is treated as a number for the comparison. You’d probably be ok without it, but it doesn’t hurt.

Tax query with multiple terms in pre_get_posts

Just use: ‘terms’ => $rt_cat_id I’ll work for both array and single-based values. Or you can simplify your code as follows: if( isset( $_GET[ ‘listing_cat’ ] ) ) { $tax_query[] = array( ‘taxonomy’ => ‘listing_category’, ‘field’ => ‘id’, ‘terms’ => $_GET[ ‘listing_cat’ ] ); }

Combine 2 arrays in a query parameter

This does not work because this is not how you merge two arrays: ‘post__not_in’ => get_upsell_ids(), [get_the_ID()] Instead you need to take those 2 arrays and combine them using array_merge, a standard PHP function: https://www.php.net/manual/en/function.array-merge.php Note that __not_in type parameters have a very high performance cost and do not scale, this query will be very … Read more

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