The tag has no wiki summary.

learn more… | top users | synonyms

2
votes
2answers
219 views

Extending WP_Query — Optimise SQL query

I'm storing posts, a user follows in a custom table that has the columns id, post_id and user_id. To fetch posts that a user follows I have extended the WP_Query as follows: class ...
0
votes
2answers
1k views

Prevent pre_get_posts filter on specific post type

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 and venue post type. When ...
2
votes
1answer
108 views

When querying a combination of posts and other meta fields, is there a better solution than directly modifying the WHERE value?

This question is a follow up to a question I recently asked. I've implemented what seemed to be the only solution, and it seems to work (YAY!). I just need to verify that: This is really the only ...
1
vote
1answer
358 views

How do I create my own nested meta_query using posts_where / posts_join?

Some of my posts (not all) have a price as a meta key/value. Today I use the pre_get_posts action so that my users can search for prices that are between a certain value. This is the code that I'm ...
0
votes
1answer
20 views

using posts_where for meta data on pre_get_posts

Let's say you have some code which filters posts by using pre_get_posts e.g. add_action( 'pre_get_posts', 'be_exclude_category_from_blog' ); function be_exclude_category_from_blog( $query ) { ...