Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • Programming
    • C
    • C++
    • Java
  • Web Development
    • Java Script
    • jQuery
    • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • Programming
    • C
    • C++
    • Java
  • Web Development
    • Java Script
    • jQuery
    • PHP

get_query stops working after post filter

That’s because esf_admin_posts_filter() will apply itself to your query inside esf_get_teams() too!

Adding $query->is_main_query() to the if conditions inside your filter should prevent this.

Categories filters Tags filters, get-posts
Post navigation
How to put placeholder text in the main post input area?
Use a language specific thousand separator

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Allow Contributor to edit published post and filter by page id
  • Custom Rest API POST endpoint with conditionally required parameters
  • add element with add_action to posts from a specific category ID
  • PHP Warning: Attempt to read property “term_id” on bool
  • Is there a way to migrate via wordpress dashboard?
  • Remove Body Classes
  • Is there a JavaScript equivalent of get_post_field?
  • 404 error comes up when I go to wp-admin after first installation [closed]
  • Count the number of custom posts per user
  • How do I get reusable blocks via frontend REST API?
© 2022 Read For Learn
  • Programming
    • C
    • C++
    • Java
    • javascript
    • Python
    • R
  • Web Development
    • Java Script
    • jQuery
    • PHP
    • WordPress
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Microsoft Office
  • modx
  • root
  • Tips & Trick
  • Tools
  • windows