The tag has no wiki summary.

learn more… | top users | synonyms

12
votes
1answer
3k views

Is it possible to paginate posts correctly that are random ordered?

I found this problem on Wordpress Support and the topic unfortunately is now closed. I have this same issue... (read below) We have created a site where members can recommend things like favourite ...
1
vote
1answer
2k views

Order get_terms() By Custom Field

I want to order my categories like I order my pages. I've added an extra field called Order to my taxonomy, but how do I order my terms by this value? Adding and Saving my Order Value: /** Add New ...
4
votes
1answer
2k 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 ...
2
votes
2answers
954 views

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. desired output: ...
1
vote
2answers
154 views

List upcoming events, ordered by date in a custom field

I want to display a list of events with dates in upcoming order. Ex: 23 March, 2013, 30 March, 2013 Below is the query I'm using to filter out posts from my database: query_posts( ...
13
votes
3answers
13k views

Adding 'menu order' column to custom post type admin screen

I want to use the menu order attribute to control ordering for a custom post type that's going to be used for a specific purpose. It's easy enough to add this to the CPT via supports => ...
4
votes
2answers
448 views

Order by optional meta key?

I'm building the sorting functionality for a custom post type, and I have a custom meta value for "Featured" posts. This value is set when you tick the checkbox, otherwise it is not set. Using the ...
5
votes
5answers
2k views

Different post sort order within different categories

I need to give each post a unique post order for multiple Categories (per post) it is in. I can imagine a solution using custom fields whereby for each Category there is a corresponding custom field ...
1
vote
1answer
1k views

Order Admin sub-menu items?

I am adding items to a CPT Admin menu using add_submenu_page which works great, but they are added to the bottom of the sub-menu after the CPT options. I want to be able to have them on top , but I ...
4
votes
1answer
59 views

How to put last edited entry on top of the blog-post list?

In the list of my blog posts, the "last published" entry is on top. I'd like to view the "last edited" entry on top of that list. I couldn't find a setting for that, so how can I realize it?
2
votes
2answers
390 views

Orderby = none not working [duplicate]

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')); ...
1
vote
2answers
4k views

How to Change the Categories Order in the Admin Dashboard?

The order of categories on dashboard is alphabetical. Can I change it to custom order?
1
vote
3answers
824 views

WP_query 'orderby=none' Problem

I have another database which stores post's IDs and I want do display them using WP_query to use the WP default pagination. I'm using orderby => none to preserve the original order, but the result ...
0
votes
1answer
108 views

Compare 3 custom fields and sort by oldest

I am building a movie archive. For each movie I am filling out the release dates for 3 countries, they're stored as custom fields (added via Pods) Now, when listing the movies I would like to build ...
0
votes
1answer
209 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; ...
0
votes
1answer
2k 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 ...
0
votes
2answers
2k views

Order users by custom user meta

I'm showing a list of users like so: <ul> <?php $directors = get_users('role=director'); foreach ($directors as $director) { $dir_id = $director->ID; ...
0
votes
1answer
77 views

Order posts by date and then by custom field

I am trying to do something like this one. Ordering posts by day (not time) AND meta value I want to list blog posts ordered by date (not time) and then within that day, I want to sort them by custom ...
6
votes
1answer
16k views

WP_Query - Order results by meta value

I've checked around and haven't seen an answer which works as of yet. I have a WP_Query with the following arguements: $args = array( 'post_status' => 'publish', 'post_type' => ...
3
votes
3answers
310 views

Display all posts in category, with specific tag posts at top

Rephrase question I need to order posts inside the loop for my category car. What I need, if I visit the category page of car, I need all posts tagged BMW to display first, and then the other posts ...
0
votes
1answer
279 views

Order search results by category

I'm using this code to order my search results by post type and title, but I would like to order by category too. How can I do it? add_filter('posts_orderby','my_sort_custom',10,2); function ...
3
votes
1answer
540 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
1answer
249 views

Custom Post Type order by modified date and custom meta field issue

I'm creating a plugin with some kind of offers that users can publish. User, in his custom administration panel, can managed his own offers. Offers are free and premium. If offer is premium it take ...
2
votes
1answer
739 views

Order Posts by Taxonomy and Meta Value

It's possible to order posts by Meta Value. It's possible to order posts by more than one value. And thanks to the code below it's possible to order by taxonomy. But how can I alter the code below ...
2
votes
3answers
540 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 ...
1
vote
1answer
277 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 ...
1
vote
1answer
192 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, ...
1
vote
2answers
3k views

Displaying a custom post type alphabetically

I've created a custom post type which now has around 100 posts in it. I simply want to display these in alphabetical order by the post title rather than the default which seems to be most recent ...
0
votes
2answers
45 views

ascending order custom post type

I'm trying to sort a custom post type in ascending order (instead of the default descending). Registering the post type like so: function codex_custom_init() { register_post_type( 'calendar', ...
0
votes
0answers
41 views

Auto order posts of custom post type by title

I have a custom post type which has more than 50 posts. I want to reorder them alphabetically so that each time I post anything the system automatically reorders. Please don't suggest post order ...
0
votes
2answers
167 views

Order Posts by Alphabetical for Each Letter

I need to order my posts by alphabetical for each letter. I mean: When people enter to www.xxx.com/a, they will just see posts by starting A. ABC XYZ ADE KLM ARE UYZ When people enter to ...
0
votes
2answers
76 views

How to order posts in wp_query by a meta_value of the corresponding author

Is it possible to order posts retrieved via WP_Query according to a meta value of the corresponding post author? Use case: I have premium subscribers and basic subscribers. I want the posts of the ...
0
votes
1answer
235 views

Rearrange elements outputted by comment_form()

I'm currently developing a custom theme from scratch. In the past week, I've been trying to change the order of the HTML elements output by the comment_form(). I basically don't know any PHP, and I ...
0
votes
1answer
93 views

Get a Page's attachments in Gallery order

Having created a page and a gallery within that page, I would like to retrieve all the images in that gallery in the order they are set when the gallery is created, i.e. the order which I drag them in ...
0
votes
1answer
78 views

Order by Custom Field date not recognized

Ok, so I have this custom field wpcf-evento-data-inicio1 generated with the (great) Types plugin. This is how it stores on db: 1372896000 OK, so I want to order by this value. I'm doing it by url ...
0
votes
1answer
423 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
1k views

How to choose a sort order (for posts) per category? (ideally when creating a new category)

Assume I have a bunch of posts (articles) in two categories: "upcoming events" (cat=1) and "past events" (cat=2). When listing all posts of a specific category out of those two, category 1 shoud be ...
0
votes
1answer
287 views

Custom WP_Query breaks default behaviour of viewing right post associated with tax-term!

I have a custom-taxonomy for a custom-post-type just like categories. I've used the standard loop in my taxonomy-event_type.php template so far … if ( have_posts() ) : while ( have_posts() ) : ...
0
votes
2answers
385 views

Ascending sort order for monthly & category view, i.e. ?m=201204, ?cat=4

I have my posts ordered ascending (from oldest to newest) because I use Wordpress as a website to accompany a book published based on the original blog. To do this I put the following code just before ...
0
votes
1answer
474 views

Arrange Posts By Date In Order Of Closest To The Current Date

I have a list of events on a clients website that show in a sidebar. When viewing the homepage you see one event and if you're anywhere else on the site you see two events in the sidebar. I am ...
0
votes
5answers
2k views

Order by first name

I'm trying to order the member list by display_name or first name ASC. http://sim.is/sim/felagatal-sim/ This doesn't seem to work. Any pointers out there? :/ $users = get_users(array( 'role' ...
0
votes
2answers
1k views

Sorting within nested queries / multiple meta keys

I have the following ALMOST working perfectly, but have run into a couple of issues. Right now this displays a Books archive page, ordered like this: Genre Name -- Series Name --- Books ...