0
votes
0answers
30 views

query_posts with sorting on a custom datestamp

I have a custom meta field that I want to use to sort with query_posts but its not ordering my posts properly since it is a datestamp (i.e. 04/21/2014) and its treating it like a normal text string. ...
0
votes
1answer
59 views

Ordering custom post type by custom field without a title

My custom posts don't have a title, rather they rely on custom fields, and all the solutions I've tried so far seem to work if the title is present. <?php $paged = (get_query_var('paged')) ? ...
0
votes
2answers
44 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". <?php if ( ...
0
votes
1answer
562 views

orderby:date not working

I have been searching for an answer and it seems like there are a lot of answers for the opposite issue. I am trying to sort by publish date, not by date modified, using this code: ...
0
votes
1answer
270 views

Order posts alphabetically: how to set order=asc in mysql query?

I have this function: global $wpdb; // adjust the query to fit your needs $posts = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE post_type = 'post' ...
0
votes
2answers
72 views

While loop articles - if statement order

I want to show a list of articles, but I want to show in the 1st place my second article and after it the last. Eg: Article 1 Article 2 Article 3 Article 4 to be: Article 2 Article 1 Article 3 ...
1
vote
1answer
140 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
314 views

Transfer taxonomy to custom field

I have a blog with movie critics and I'm using many taxonomies to add some informations about the movies, like director, actors or it's year. Using taxonomies is really useful to display all movies ...
2
votes
1answer
777 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 ...
0
votes
1answer
975 views

WP_Query ordered by custom field that is a date string?

Each of my posts have a single custom field that is a string of a date (not the date of the post). Instead of my theme's current query, which orders by published date, I want to order by this custom ...
3
votes
1answer
371 views

Order posts by ID in the given order

In the back-office of my theme, the users can choose which posts to display in the front page, and they can also choose in which order the selected posts should appear. I have tried like this: ...
2
votes
4answers
486 views

Query Posts in a Predefined Order

I am using the query_posts function to list a 10 specific posts which lookup by post id. I have an array which looks like this.. Array ( [0] => 17983 [1] => 17932 [2] => 18030 ...
1
vote
1answer
81 views

Sorting a query Field by date

I have my site, which at the moment is display university open-days, at the moment they are sorting by order of page title, when actually I would prefer they sorted in order of date, soonest first, ...
1
vote
0answers
257 views

define orderby URL with meta_key=post_views_count

I want to make an url with meta_key=post_views_count. E.g: http://www.mysampleweb.com/?meta_key=post_views_count&orderby=meta_value&order=DESC So the posts should be ordered by Views. ...
0
votes
1answer
2k views

query_posts doesn't order by title

It seems like stupid bug, but how can i order by title? It anyways orders by date! I'm using: query_posts( array( 'post_type' => 'page', 'posts_per_page' => -1, 'orderby' ...
0
votes
1answer
570 views

orderby not working for query_posts using array of IDs

I have an array of IDs that i send to query_posts to get the posts (which works fine) but it seems to always put the attachment(562) last even though it is the newest. Also tried title and ASC vs DESC ...
0
votes
1answer
1k views

order posts by meta value on posts page

I've been reading alot about how to order posts by a meta_value, but I can't seem to get it to work for me. My meta_key is called date, and it is stored as yyyy-mm-dd. Here's where I've gotten to so ...
1
vote
1answer
1k views

Sort query_posts for Parent Pages to menue order or the count?

thanks to a member here i display my Parent Pages in a 2 column grid with title and excerpt. But for some reason i can't figure out how to sort all 5 Pages by the menu order for example or the order ...
0
votes
2answers
5k views

Sort posts alphabetically by category/custom taxonomy, insert divider between different types

first of all I'd like to thank you for all the great work you're doing. I've found a lot of useful infos and tricks taking a look around in Wordpress Answers. Well, I'm here to ask so that's my ...
1
vote
1answer
3k views

Wordpress query_posts and orderby page order

I have a page that lists all sub pages of the current page. Each page has been assigned an order number in the wordpress editor but they aren't ordering for some reason. I'm set up like this: ...
0
votes
1answer
132 views

Problem with writting correctly a query posts args in Wordpress

In my posts custom fields, I have a meta_key named ending. The value of it is a date in the form of 30-11-2011 (dd-mm-yyyy). I tried this below but with no luck. ...
1
vote
2answers
2k views

Order by & include array by specific post ids

I have the following: <?php $num_cols = 2; // set the number of columns here $args = array( 'post_type' => 'testimonials', ...