The order tag has no wiki summary.
1
vote
0answers
91 views
group posts by taxonomy terms
I have a site with two CPT's Projects and Artworks. I use scribu's posts2posts for connecting a bunch of artworks to each project.
In a single Project view, I want to display all connected artworks. ...
1
vote
1answer
147 views
WP_Query orderby breaks when using AJAX?
I'm running in to a bit of a problem.
I have a function called get_press(), it retrieves newest press items. It is inside of a plugin:
class EWPress {
function __construct()
{
...
0
votes
1answer
67 views
How can I sort posts by the date and a custom meta field?
I have custom meta field that I use for the post rating.
So I want to display posts by the date and the rating, but only for the posts that have specific rating.
For example, I want to display posts ...
0
votes
1answer
73 views
Problem with meta_value order after update
I use following array and works fine...
sort post by meta_key where value of t_count is a number:
$args = array(
'posts_per_page' => 10,
'meta_key' => 't_count',
'orderby' => ...
0
votes
2answers
190 views
get_terms orderby name as numbers
I have a custom taxonomy filled with terms such as 'volume 1', 'volume 2', 'issue 1', 'issue 2', 'issue 10' and get_terms orderby name returns list as:
issue 1, issue 10, issue 2 though I need it to ...
2
votes
1answer
146 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
100 views
Arrange posts by date in front page
I have code to show the 5 last posts from every category on the front page. However, at the moment they are ordered category by category. Is it possible to order them by post date, but still have 5 ...
0
votes
1answer
390 views
Displaying Portfolio Filter by Category Order (alphabetically)
I have created a custom post type to display churches in Europe. I used this tutorial to make it filterable: http://wp.tutsplus.com/tutorials/creating-a-filterable-portfolio-with-wordpress-and-jquery/
...
0
votes
1answer
103 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 ...
1
vote
1answer
93 views
Arrange and separate posts
On a particular archive page I've created, I'm listing a number of posts by post name and they're listed in alphabetical order. Is there away to have them separated even further?
As in all posts ...
1
vote
1answer
74 views
Order posts by price
I have a list of products on a page and am trying to order them by a custom field called "price". Unfortunately, $3,950,000 is coming before $349,000. I've used a couple of codes but neither one is ...
6
votes
2answers
118 views
alphabetically order role drop-down selection in dashboard
The site I'm working on will have a very large number of unique user roles via a members plugin. Because of that, I'd like to have the Role drop-down selection on the Add New User page to display ...
0
votes
0answers
82 views
get_option( $options ) for multiple options in an array [closed]
I have created a sortable bar where with different options of orderby queries, like Random, Most Recent and others. The code looks like this:
$orderby_sort = array(
'date' => __( 'Most ...
0
votes
1answer
149 views
WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
I'm trying to write a new "related posts" widget (for the single post view) for my custom post type, filtering by custom taxonomy terms that the related posts should have in common with the current ...
0
votes
1answer
423 views
Sorting Woocommerce products with numeric titles
Just started playing around with Woocommerce, ran into a problem. I have a bunch of items (100+) and all of them only have a number as product title, 1,2,3 etc. The problem is that Woocommerce outputs ...
0
votes
1answer
101 views
WP_Query post at custom position
Lets say I have a custom query which based on two custom post types:
$wp_query = new WP_Query(array(
'post_type' => array('post-type-1', 'post-type-2'),
'post_status' => ...
0
votes
1answer
137 views
How to Order a list of taxonomies? orderby?
I am using this code to fetch a list of child taxonomies. I want the order displayed to be alphabetical, but it is not! Any help in figuring out how to do it? I guess ordering it before returning it ...
1
vote
2answers
85 views
How do I sort posts with multiple pages
I am using a drop-down to sort posts by title, meta_value, etc. However, the sorting feature only works on the first page. The second page displays the default order rather than continuing the order ...
1
vote
1answer
116 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:
...
0
votes
1answer
96 views
Natural sort / ordering wp_dropdown_categories
I'm using the following code to display an archive dropdown:
wp_dropdown_categories( 'taxonomy=week&hierarchical=1&orderby=name' );
However the format of the taxonomy is week-1, week-2 ...
0
votes
1answer
23 views
Last three posts not being put in order by date. How to fix this?
My company adds a quote of the day each day. The last three posts that I have put are not in order though. The first quote I posted 3 days ago is at the top the post I posted yesterday is under that, ...
1
vote
1answer
44 views
All, published and pending order
On the list tables of the administration panels, I want to change the order of the filters on top of the table.
What I want:
Pending
Published
All
I tried to act on a line from the ...
1
vote
1answer
94 views
query order by date on custom type: wrong order
I know there are very similar questions ans answers out there already, but I simply cannot get my query to get into the right order.
I have a custom post type ("bb_articles") with custom fields, ...
2
votes
1answer
294 views
Order posts by (hierarchical custom) taxonomy terms and term children
The scenario
a custom post type wiki
a (hierarchical) custom taxonomy topics
a page template archive-wiki.php
The situation
Posts show up and get ordered by post_date (which is the default).
The ...
1
vote
2answers
220 views
Order query by post meta value
//Displaying latest post per author on front page
function filter_where($where = '') {
global $wpdb;
$where .= " AND vipwp_posts.id = (select id from {$wpdb->prefix}posts p2 where ...
2
votes
4answers
184 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
164 views
WP_Query - filter by multiple meta values and order by other meta values
I'm trying to query posts using WP_Query and meta_query parameters:
$args = array(
'post_type' => 'produkty',
'meta_query' => array(
'relation' => 'AND',
...
0
votes
1answer
63 views
Random order of posts on each request
I want my testimonials to be shuffled everytime someone clicks on my testimonials page so that it is not the same one on top all the time.
How can I do this? Where should I put the code?
I am ...
0
votes
1answer
54 views
Order by meta values
I have 3 meta fields related to dates:
year = 2012
release_date = 14 November 2012
release_date_db = 20121114
I need to show the posts from year 2012 sorted by release_date.
I made this:
...
0
votes
2answers
58 views
how to retrieve WP_Query without ordering by date [duplicate]
Possible Duplicate:
Orderby = none not working
I want to use $query = new WP_Query( 'post__in' => array( 2, 5, 12, 14, 20 ) ) ); to retrieve posts by ID, I do and the result ordered by ...
1
vote
1answer
84 views
Custom order for Mysql array
I have a Page of Posts, each post has a Custom Field "expired" which contains a date in the format YYYY-MM-DD which is used to order the posts. This date is used for a script that tells the visitor if ...
1
vote
2answers
875 views
Custom post type - order field
In a custom post type, is there a way to include the "order" field that is available for pages?
Is there any built-in logic that prevents duplicate values in the "order" field?
The idea is to be ...
0
votes
1answer
32 views
How do I get a array, with the right order of the nested comments?
array (size=10)
'comment 0' =>
array (size=2)
'comment_id' => string '22' (length=2)
'parent_of' => string '0' (length=1)
'comment 1' =>
array (size=2)
'comment_id' => ...
0
votes
1answer
145 views
Adjust the order for returned posts
I have written a neat responsive slider for my Wordpress featured articles (feel free to use it):
<?php
$responsive = 'on' != get_option('henrik_responsive_layout') ? false : true;
...
1
vote
1answer
158 views
Secondary Sort (fallback) for WP_Query
What I'm after is creating a secondary (or default) orderby option for a custom query. Here is what I have:
$post_args = array(
'post_type' => $taxfunc_post_type,
'meta_key' => ...
1
vote
1answer
242 views
what types of order can I pass to get_posts() via orderby?
Here describes get_posts() function. I would like to know what types of order can I pass to get_posts?
in WP admin, I can see menu order, title, date, random and ...
2
votes
2answers
199 views
Orderby = none not working
I'm trying to set 'orderby = none' to my loop but it is not working. Here's my code:
$query = new WP_Query(array('showposts'=>2, 'post__in' => array(99,4,5,2,8,55), 'orderby'=>'none'));
...
0
votes
2answers
144 views
Multiple Orderby's using random order WP_Query
Here is the setup.
The site in question is a website that displays listings. Each listing has a rank (1-3). Basically it's a listing type... small, medium & large to determine how much the ...
1
vote
0answers
219 views
Meta query with multiple custom fields for archives page ordering problem
I'm modifying the query for archives pages so that the posts showing up on year, month or day pages are queried by there custom field (start-date and end-date) and are sorted by custom star-date ...
0
votes
2answers
248 views
How to order different custom post type in category or tag template page?
I have 3 differents custom post type : "Projet", "Notice" and "Disque".
I want them to appear in a specific order when they are listed in the category or the tag template page.
Like that :
1 - ...
1
vote
0answers
149 views
Trying to perform complex custom field query with order by set to field value
I've got two custom fields for event posts: event-start and event-end. When I'm querying for current events, I'd like to show any post where the event-start OR the event-end is greater than or equal ...
1
vote
1answer
73 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, ...
3
votes
2answers
210 views
Sort posts by custom field numeric value using dropdown
I've read umpteen answers and questions about things that are very similar to this but I just can't get it to work for my specific situation.
I have some posts with a category of "property". In ...
0
votes
1answer
131 views
Ordering by 'Title' OR 'Custom Field'
I have an issue here that I just can't wrap my head around. Let me jump right into it:
Basically I have a site that has 4 order options;
-Name Ascending
-Name Descending
-Price Ascending
-Price ...
3
votes
1answer
553 views
Sort posts by popularity/page views
How can I sort posts by popularity or page views in my template file?
I guess I need to count page views first, is there any good plugin to integrate with to sort posts by views or what is the best ...
0
votes
1answer
368 views
Order by custom field date with ASC order
I've found several similar question but none of them explains why the below is giving me nothing with ASC order. It works with DESC.
Basically it's a query that should list posts where the custom ...
1
vote
0answers
134 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.
...
1
vote
0answers
90 views
Manage Columns : order by post_parent's title
I have 2 custom post types : "industry" (page + hierarchical) and "product" (post + hierarchical). This allows me to use Industry for Product's post_parent.
On the Product manage screen, I have a ...
0
votes
1answer
490 views
Sort wp_nav_menu() by menu order
I have made a custom menu handler for the back end, sorting the via a drag drop based on CMS Page Order.
The problem now is that it seems that it's not possible to sort wp_nav_menu in any other way ...
0
votes
1answer
297 views
show most viewed posts of last days by link?
I use this link to get most viewed posts:
http://mydomain.com/?post_type=movies&meta_key=post_views_count&orderby=meta_value&order=ASC
But that gives me ALL posts from this post type ...
