Filtering posts for unique titles, only the most recent

You can try this. However, I am sure there must be a better alternative.. $past_events = get_posts(array( ‘post_type’ => Tribe__Events__Main::POSTTYPE, ‘paged’ => $paged, ‘posts_per_page’ => ’10’, ‘eventDisplay’=>’past’, ‘orderby’=> ‘title’, ‘order’ => ‘ASC’, ‘s’ => $searchText ?: ”, )); $post_arr = array(); foreach ( $past_events as $past_event ) { $post_arr[ $past_event->post_title ] = $past_event->ID; } $post_arr … Read more

Filter custom WP_Query by first letter of a custom field – hopefully using Search and Filter Pro?

If Search and Filter Pro doesn’t help with this out of the box, it will take more effort to achieve this. What I would do: Move query to a separate function that would stay in functions.php file. It would return query results (example bellow). function theme_prefix_return_professionals($type=”professionals”, $fid = ‘204’) { $letter=””; $post_type = $type; $filter_id … Read more

Search with WP_Query, but ignore href URLs in anchor tags?

Please Use This. Solution Question:- Search with WP_Query, but ignore href URLs in anchor tags. Answer-> add_filter(‘posts_where’, ‘update_search_query’ ); function update_search_query($where) { if( is_search() ) { global $wpdb; $query = get_search_query(); $query = like_escape($query); $where .=” AND {$wpdb->posts}.post_content NOT REGEXP ‘\<a{1}.*.$query.*.<.a\>{1}’ “; } return $where; }

Show specific posts with WP_Query using ACF Post object

now we are getting there.. you really need to try to explain, what your problem is, its not very clear in your question. my assumption is, you tried this one, but it didn’t work out: foreach( $post_objects as $post_object): get_template_part( ‘includes/content’, get_post_format( $post_object->ID ) ); endforeach; and here is why: you call the template, but … Read more