Display related CPT with custom taxonomy

I was building something similar a couple of years ago, here’s what I did, maybe it helps … (changed to your use case) $result = new WP_Query([ ‘post_type’ => ‘location’, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘posts_per_page’ => -1, // all of them on one page ‘tax_query’ => [ [ ‘taxonomy’ => ‘services’, ‘field’ => … Read more

I’m having trouble with Related Product “tax_query” ‘terms’ value

How is ‘products_article_list’ meta returned from in $article_list? <?php $article_list = get_post_meta( get_the_ID(), products_article_list’, true);?> Is it a list of ids eg. ‘0601,0603’ or is it an array? tax_query terms argument requires an array. See https://developer.wordpress.org/reference/classes/wp_query/#taxonomy-parameters So if it’s stored as a list of ids all you need to do is explode the list and … Read more

Show posts from two specific category in WP_Query

So you want to show only posts that have both employee and full-time categories. If that is the case than you can do the following. Because you haven’t posted the full query args I will only show the tax_query part ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘category’, ‘field’ => ‘slug’, ‘terms’ => … Read more

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