Order by summing multiple values

I wouldn’t use taxonomies or custom fields for this purpose. Every time you’re add one custom field for a query, you have to add a JOIN part for that query – it means that with 10-15 custom fields, you’ll get query with 10-15 joins – so such query will be very slow. But there is … Read more

Show posts from a custom taxonomy on a page

Most of your code looks OK. But there is a major problem with your WP_Query in portfolio template. Your query looks like this: <?php $query = new WP_Query( array( ‘slug’ => ‘design’ ) );?> And if you take a look at WP_Query docs, you’ll see there is no parameter called slug. So it’s pretty clear … Read more

Assign Json file to WP_Query

Found the solution. $wp_query returns an array of objects. Therefore when decoding the json set teh second parameter to false like so json_decode($str, false); Then assign the returned values to object vars like so: if (is_file($file)){ $str = file_get_contents($file); $my_query_raw = json_decode($str, false); $my_query1 = null; $wp_query = null; $my_query1 = new WP_Query; $posts_son = … Read more