Get posts that do not have the same tags as current

I found an answer to my own question: If I use the tax_query arg then I could specify ‘operator’ => ‘NOT IN’ like so: $events = tribe_get_events([ ‘tax_query’ => array( array( ‘taxonomy’ => ‘post_tag’, ‘field’ => ‘name’, ‘terms’ => $current_tag, ‘operator’ => ‘NOT IN’ // HERE ) ), ‘start_date’ => ‘now’, ‘eventDisplay’ => ‘list’, ‘posts_per_page’ … Read more

Is this meta query problematic?

Short answer is: Big Meta Queries are incredibly bad and can quickly lead to the MySQL-Server not responding anymore. You should try to rework the meta_query to not have so many clauses. Long Answer: Wordpress Post Metadata is stored incredibly inefficient when it comes to querying. Best advise would be to never ever EVER store … Read more

Loop increase in while loop not working

You’re reassigning 1 to $i on every loop: if ( $i = 1) { This should be if ( $i == 1) { or even if ( $i === 1) { which will also compare the post type, which is best practice. In PHP, = is assignment, == is comparison: