Filtering more than one term in a taxonomy in WP

You can use tax_query and use the AND condition: Reference: WP_Query under Taxonomy Parameters $args = array( ‘post_type’ => ‘post’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘hotels’, ‘field’ => ‘slug’, ‘terms’ => array( ‘1 Star’ ) ), array( ‘taxonomy’ => ‘location’, ‘field’ => ‘slug’, ‘terms’ => array( ‘loc1’ ) ) ) ); … Read more

Archive by custom post type and custom date field

Thanks to Milo for helping me through this. Here is the code that worked for me. function custom_events_query( $query ) { if ( $query->is_main_query() && $query->is_archive && !is_admin()&& is_post_type_archive(‘events’) && $query->query_vars[‘m’]!=”) { $query->set( ‘post_type’, ‘events’ ); $query->set( ‘meta_key’, ‘event_date’ ); $query->set( ‘orderby’, ‘meta_value’ ); $query->set( ‘order’, ‘DESC’ ); $query->set( ‘post_per_page’, 10 ); unset($query->query_vars[‘year’]); unset($query->query_vars[‘monthnum’]); unset($query->query_vars[‘day’]); … Read more

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