search filter add priority to post_type and add order to some post_type

Here is the code from the provided link after adaptation. add_filter( ‘posts_orderby’, ‘se344727_custom_search_order’, 10, 2 ); function se344727_custom_search_order( $orderby, $query ) { global $wpdb; if (!is_admin() && $query->is_main_query()) { if ($query->is_search) { // — sort by: type, title, date — // ” ELSE 2 END ASC, ” . $orderby; // — sort by: type, date … Read more

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