My theme calls the update_meta_cache() function 58 times per page! This function appears to run the following query based on the post in question: SELECT post_id, meta_key, meta_value ->...
I have a simple filter running on the main query on the front page, it should be excluding all posts with a particular meta value (by only including posts...
I’m using a custom search filter (using my custom query var type), like so: function fteh_pre_get_posts( $query ){ if( isset( $query->query_vars['type'] ) ) $types = explode( ',', $query->query_vars['type'] );...
What I am trying to do? My blog uses a custom taxonomy called edition with terms like us-canada (6), eu (7) and india (8) — term slug (ID). I...
I have a hierarchical CPT with the following structure: - parent item 1 - child item 1 - child item 2 - child item 3 - child item 4...
This question refers to @Pieter Goosen´s extensive work about how to alter the main query using the pre_get_posts hook on true pages. It is also referenced in the codex....
This seems like it should be straightforward, but I’m stuck on it! If a user searches for ‘alice’, I would like to show them all posts with the custom...
There are lots of good resources on how to alter the main query, or add secondary loops… But I actually want to completely replace the main query with a...
I am looking to add a custom column to a custom post type post listing table in the dashboard. I have read many questions / answers on WPSE, along...
I am running into one issue with pre_get_post filter. Actually I have 4 post types. Post, Pages, Events, and Venue. I created one custom field called city for event...