Why does ‘meta_key’ return an empty array in get_pages

I’m not sure if this is still true, but i tried this one time and found a similar question: Understand this is not my answer, but what i found that ended up working. It was a year ago, and I haven’t tried if querying by meta_key works yet… From this question: https://stackoverflow.com/questions/32104826/wordpress-get-pages-meta-key-dont-show-page This is the … Read more

WP_Query to get posts in a specific tag or has post_format

Try Below Code :- $query = new WP_Query(array( ‘posts_per_page’ => 2, ‘tax_query’ => array( ‘relation’ => ‘OR’, array( ‘taxonomy’ => ‘post_format’, ‘field’ => ‘slug’, ‘terms’ => array( ‘post-format-link’ ) ), array( ‘taxonomy’ => ‘space’, ‘field’ => ‘term_id’, ‘terms’ => array(’16’), // 16 is the code for tag longform ‘operator’ => ‘IN’ ) ) ));

Get Posts from Custom Meta Query

Add ‘relation’ => ‘OR’ to your Meta Query, I think it will be something like this… ‘meta_query’ => array( ‘relation’ => ‘AND’, // Optional, defaults to “AND” array( ‘key’ => $country_meta_key, ‘value’ => $country, ‘compare’ => ‘LIKE’ ), array( ‘relation’ => ‘OR’, array( ‘key’ => $state_meta_key, ‘value’ => $us_state, ‘compare’ => ‘LIKE’ ), array( ‘key’ … Read more

How to Group While Loop “Results” of wp_query?

I will probably do something like this to make it dynamic but this have some issue with the title that must be “Season $n” in the title. Probably better solution will be to add some custom field with the season or some custom taxonomy just to filter. if ( $my_query->have_posts() ){ $seasons = array(); foreach($my_query->posts … Read more

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