Sorting: custom query with orderby meta_value_num THEN by title
i try to run a custom post type query to match following criteria:
sort movies first by year in descending order,
after that (“inside” the year order) by title alphabetically.
i try to run a custom post type query to match following criteria:
sort movies first by year in descending order,
after that (“inside” the year order) by title alphabetically.
I’ve created a custom post, events, and saved the meta data event_year to each event. I’m trying to get a year’s event archive. When I go the the following URL, the meta_key and meta_value are not set for some reason, and thus the event archive is unfiltered.
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 easy way to do this without having to unserialize it? Thanks!
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 deprecated meta_key.
I know many people asked for this question but I didn’t find a proper way to do it. How to add a simple meta_query (product_cat) before the execution of the shop page’s query.
I have a custom meta query which is terribly slow or doesn’t even load till the end. With up to three arrays in 'meta_query' the query works fine, with four and up it doesn’t work anymore.
Overview: I am not trying to return a post. I simply want the single highest value for a particular meta_value across all posts… just the value itself.
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 value of either; public or private. Public posts are shown on the site and private posts aren’t.
I have a query as follows:
Not sure how to achieve this. I’m trying to mix standard posts and custom posts on a site homepage but I only want to display the custom posts if a meta value is set. Displaying the posts works fine 'post_type' => array('game', 'post') but when I add in the meta_query the regular posts are no longer displaying (which makes sense as they don’t meet the meta_query condition).