The posts-where tag has no wiki summary.
1
vote
1answer
92 views
Get Posts updated or published within the last x hours
Okay, I'm trying to get posts that have been published within the last x amount of time, options being 8, 24 or 72 hours. I have the variables being passed to my featureHandler.php via ajax, then ...
2
votes
0answers
40 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 ...
0
votes
1answer
186 views
Using dynamic conditions in 'posts_where' filter
I have the following code which gives be posts that are published in the last 100 days
function smbd_cats_by_days ($where = '') {
$where .= " AND post_date < '" . date('y-m-d', ...
2
votes
2answers
202 views
Custom time range for the posts_where filter
I'm creating a function that displays the most viewed posts and would like to be able to show posts based on how old they are. Modifying the query is not really a problem. But since I can't pass any ...
2
votes
1answer
595 views
Search ONLY by meta key / meta values
I'm almost there on this one.
On functions.php i have this:
function base_home_product_post_type( $query ) {
if($query->is_search() && $_POST['box'] == 'sku') {
...
4
votes
0answers
111 views
Custom query incorrectly returning everything [closed]
I'm missing something somewhere, but I cannot connect the dots. Everything outputs properly except that the query returns everything from the DB, not just posts. Can anyone spot a reason for this ...
1
vote
1answer
280 views
Compare post-IDs within WP_Query? (Less than / Greater than)
Can I use WP_Query to only query posts less than (or greater than) a given post ID?
$filtered_query_args = array(
'post_type' => 'projects',
'order' => $prev_next=='next' ? 'DESC' : ...
1
vote
1answer
325 views
Including Custom Meta with posts_where query
I have been looking around to see how to do this but the solutions i've found don't seem to be working for me.
I'm making an AJAX powered search for some wordpress custom post types. I have got ...
1
vote
2answers
537 views
Only retrieve posts where post_excerpt has been filled out
I'm trying to use get_posts to only return posts that have an excerpt. Done lots of searching and have been trying to use "posts_where" filter on the query but my SQL is lacking. This is what I'm ...