Query posts that not start with a letter (a-z) but everyting else
-
Hello everyone
With the following function i can easily query all posts that start with a certain letter:
function wpse_298888_posts_where( $where, $query ) { global $wpdb; $starts_with = esc_sql( $query->get( 'starts_with' ) ); if ( $starts_with ) { $where .= " AND $wpdb->posts.post_title LIKE '$starts_with%'"; } return $where; } add_filter( 'posts_where', 'wpse_298888_posts_where', 10, 2 );
But now i need to query all posts that are not starting with a default letter from a to z. Is this possible? Thank you so much!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Query posts that not start with a letter (a-z) but everyting else’ is closed to new replies.