Test

string(1302) "Database Error; SQL: SELECT
                
                DISTINCT
                `t`.*
                FROM `wp_posts` AS `t`
                
					LEFT JOIN `wp_term_relationships` AS `rel_category` ON
						`rel_category`.`object_id` = `t`.`ID`

					LEFT JOIN `wp_term_taxonomy` AS `rel_tt_category` ON
						`rel_tt_category`.`taxonomy` = 'category'
						AND `rel_tt_category`.`term_taxonomy_id` = `rel_category`.`term_taxonomy_id`

					LEFT JOIN `wp_terms` AS `category` ON
						`category`.`term_id` = `rel_tt_category`.`term_id`
				
                
					LEFT JOIN `wp_postmeta` AS `rescue_date` ON
						`rescue_date`.`meta_key` = 'rescue_date'
						AND `rescue_date`.`post_id` = `t`.`ID`
				
                WHERE ( ( (`category`.`name`='Adoption') NOT (`category`.`name`='On trial') ) AND ( `t`.`post_type` = 'dog_adoption' ) AND ( `t`.`post_status` IN ( 'publish' ) ) )
                
                
                ORDER BY `rescue_date`.`meta_value` ASC, `t`.`menu_order`, `t`.`post_title`, `t`.`post_date`
                LIMIT 0, 30; Response: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(`category`.`name`='On trial') ) AND ( `t`.`post_type` = 'dog_adoption' ) AND...' at line 22"
[wp_show_posts id=”29791″]

Dogs available, not on trial

Dogs on trial