Taxonomy.php issue with search and filters
After some tweaking I’ve discovered that I’ve totally forgotten the relation into meta_query. so I’ve just added ‘meta_query’ => array( ‘relation’ => ‘AND’, $closed, $ends, $budgets, ), and it worked fine.
After some tweaking I’ve discovered that I’ve totally forgotten the relation into meta_query. so I’ve just added ‘meta_query’ => array( ‘relation’ => ‘AND’, $closed, $ends, $budgets, ), and it worked fine.
First point is that you should NOT use query_posts() for custom queries. The better approach is to use the WP_Query class. More info in the WP docs and here. This example will display your 2 featured posts and then exclude them in the second query. // We will push the ID of your featured posts … Read more
Going from memory this should work for posts <?php $query1 = new WP_Query( array( “post_type” => “post”, “tag” => $term->slug) ); ?> The first query will only return posts that have been tagged [TEAMNAME] (as far as I can remember custom taxonomies can show up as tags on a post). This should work for teams … Read more
To do so .. You need to login to wordpress admin and then need to save the permalink again.. Just go to Settings >> Permalink And save without doing any changes.. and that error should be gone..
Firstly, don’t use query_posts() It should be noted that using this to replace the main query on a page can increase page loading times, in worst case scenarios more than doubling the amount of work needed or more. While easy to use, the function is also prone to confusion and problems later on. See the … Read more
I prefer to use WP_Query (for more info read “When should you use WP_Query vs query_posts() vs get_posts()?“), try this way: $args = array( ‘post_type’ => ‘soiree’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘orderby’ => ‘date_de_concert’, // you don’t need ‘meta_key’ => ‘date_de_concert’ when using meta_query //’meta_key’ => ‘date_de_concert’, ‘order’ => ‘DESC’, ‘meta_query’ => array( … Read more
I think the easiest way would be to create a third meta field for “score” and use the WordPress update_post_meta() function to automatically calculate its value, based on the values of assignment_value and current_grade. Exactly how to do that has been answered well in this response: https://wordpress.stackexchange.com/a/54068/16 Once you have your third “Score” meta field, … Read more
Hi @webcodeslinger: Here’s what a basic MySQL query for loading News and Events would look like (this is greatly simplified from what WordPress actually does): SELECT * FROM wp_posts WHERE post_type IN (‘news’,’events’) What you want instead is something like this (there are more performant ways to do this in MySQL but they are more … Read more
I would suggest creating a new custom taxonomy for relations between a post and its “tracks” or grouping of track posts if you’d like that way you can easily create a shortcode that will query all the needed tracks at once using a shortcode instead of calling your shortcode over and over and to order … Read more
I guess its because you are trying two conditions on one taxonomy, you can allways create a custom sql query, something like this: $querystr = ” SELECT * FROM $wpdb->posts LEFT JOIN $wpdb->term_relationships ON($wpdb->posts.ID = $wpdb->term_relationships.object_id) LEFT JOIN $wpdb->term_taxonomy ON($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) LEFT JOIN $wpdb->terms ON($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id) WHERE $wpdb->posts.post_type=”resource” AND $wpdb->posts.post_status=”publish” AND $wpdb->term_taxonomy.taxonomy = … Read more