0
votes
0answers
14 views

Filter RSS feed for custom post type to events for next 7 days only

I'm trying to create a custom RSS feed that shows posts from the custom post type 'events' for the next 7 days ahead only. The feed is already sorted by event start date order rather than published ...
0
votes
0answers
16 views

Posts Duplicating due to Pagination and Custom Query

I have a custom meta field named “price” and I would like my main query to order the posts from highest to lowest price. Currently I have it setup like this: <?php $paged = ...
0
votes
3answers
666 views

Custom Query With Multiple Meta Key Value

I am new with WordPress development and I have found this query and I want pass multiple key and value in this query. My Query is: $querydetails = " SELECT wposts.* FROM $wpdb->posts ...
0
votes
1answer
39 views

query post based on comparison

Each post in my site can be rated as 'good' , 'ok' , 'bad'. The values are stored in custom fields. I now need to show top 10 posts with maximum 'good' and it should not display posts with greater ...
0
votes
2answers
51 views

WP Query - Is this correct?

Trying to debug, getting headache so I want to ensure that I have placed the query args in the correct place. I want to sort/order all my posts based on "myvalue". if ( have_posts() ) : /* Start ...
1
vote
1answer
354 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
395 views

Why doesn't my WP Meta Query return any results?

Is it not OK to accept a value from $_GET as the key in a WP Meta Query? I'm not sure why this code doesn't return any results... BOTH the queries for Price as well as bedrooms do not return any ...
1
vote
1answer
89 views

Get posts between custom dates

I created an event CPT and a meta box with a date. I saved the date as post_meta in the form dd.mm.yyyy. Now I want to create a shortcode that queries all posts which's dates meet the condition ...
2
votes
1answer
502 views

Perform query with meta_value date

I am trying to perform a query on a custom-type post using the value of a custom field. This field contains a string date: dd.mm.yyyy. The post type name is 'event' The custom field name is ...
1
vote
1answer
144 views

Change order of posts

I made a post recently that did not explained myself right! Come again, but with better explanations. I need the "Select Option" change the order of query_posts. My current code is: <select> ...
0
votes
1answer
87 views

Checking if field is set before comparing with meta_query in query_posts?

I have a query set up to compare the start and end dates for some custom fields. The start date is required for the post; however, the end date is not. This causes some issues with the following: ...
2
votes
1answer
305 views

Using database meta_values to calculate new post order using pre_get_posts or a 'request' hook

UPDATE: I have worked out my implementation of the selected answer at the bottom of this post. I'm implementing a sorting algorithm based on Reddit's hotness algorithm, in addition to a time-decay ...
2
votes
1answer
277 views

order by meta_value serialized array

Hi I'm trying to pull posts using the wp query. Just one problem--I am trying to sort the posts alphabetically by a certain meta_value. Thing is that this meta_value is a serialized array. Is there an ...
2
votes
2answers
2k views

Sort Posts by Multiple Meta Values

1) Custom Post Type named "Buying_Locations" 2) Each Post has three meta values of: State, City, Store Name QUESTION: How can you show a list of these posts sorted alphabetically by State, then ...
2
votes
1answer
825 views

Order by meta_key with two meta_queries

This should be simple, but I just can't pinned down a good example of the correct syntax to do this. I want to order by the specified meta_key with two meta_queries. The problem is query_posts ...
3
votes
1answer
4k views

Nested meta_query with multiple relation keys

I am curious whether Wordpress is able to run nested meta_query, with each having different relation keys? As of Wordpress 3.0, tax_query is able to perform this function; I'm wondering whether this ...
0
votes
1answer
173 views

WP_Query Class custom field parameters

In the the class WP_Query, using the meta_query(array). The wordpress codex says that the 'value' is a string|array. The array support is limited to a compare value of 'IN', 'NOT IN', 'BETWEEN', or ...
1
vote
1answer
242 views

meta_value_num sort glitch

i have a custom query, and I have a meta key that contains a sequence number: 1.1, 1.2, 2.1, 2.2... 11.1, etc the problem occurs when the numerical sequence gets in to double digits, ie. 5.11, 5.12, ...
1
vote
1answer
865 views

search query within custom taxonomy term, post title and meta field

I want to create a search that does: Search within my custom taxonomy - custom-tags search the post title search select meta field ?? dont know search with custom post type - easy part I looked ...
0
votes
1answer
61 views

Meta query stopped working

The following query stopped working all of a sudden and I can't figure out why. <?php $today = date("Y/m/j"); query_posts(array( 'post_type' => array('events'), 'meta_key' => ...
1
vote
0answers
470 views

filter custom field values $min $max

The user needs to query posts by entering a $minPrice, $maxPrice and a category value. Here is my query which returns no results: function result() { $result = array( 'cat' => ...
1
vote
2answers
1k views

Using Query Posts With Multiple Post Types And A Taxonomy

I am developing a site that has two different custom post types; one of them is called Articles and one is called Sketchpad. Sketchpad is user submitted content that is assigned a custom taxonomy term ...
1
vote
1answer
1k views

WP_Query last five posts, simply ordered by meta_value

I can't believe I'm asking this question. It feels like such a simple method, yet I've poured over the WP pages and dozens of similar questions to no avail, so here it is... I've got a WP_Query with ...
0
votes
1answer
2k views

Filter Loop by Custom Field Value

I'm trying to filter a loop by a custom field value. I've tried all of the suggestions on the site, but it just won't filter. This loop is being used for a custom template of an rss feed. It pulls ...
0
votes
1answer
210 views

Querying multiple values from a single key

Bainternet assisted me earler with the relation AND parameter. What I need to do now is determine how to query multiple vales from a single key. If I try to specify two arrays with the same key the ...
0
votes
2answers
708 views

Custom query looking at multiple custom fields and properly sorting

For the past two weeks I've been looking for a way to create a query in wordpress that returns all custom post types where a meta_key "mytype-expired" is NOT set to "yes" and then order the results by ...
6
votes
1answer
9k views

How to query_posts using meta_query to orderby meta_key AND have a secondary sort by date?

I've been troubleshooting an issue over the past few days and keep going in circles. Could really use a fresh pair of eyes to help me answer this question... So I'm working with a wordpress site ...
5
votes
1answer
5k views

Using meta_query, how can i filter by a custom field and order by another one?

With the following code (in functions.php) my posts (of CPT event) are ordered by _end_date instead of _start_date. What's the proper solution to this as of WP 3.1.3? Of course I'd like to avoid using ...
4
votes
4answers
5k views

Fail to compare dates in meta_query

This is the piece of code I use to get event posts whom date metadata is newer than today : <?php query_posts( array( 'post_type' => 'concerts', 'meta_key' => ...