The tag has no wiki summary.

learn more… | top users | synonyms (1)

0
votes
0answers
27 views

How to sort a WP_Query array by post_name after an array_merge();

I have an WP_Query array made up from two WP_Query() objects merged together as follows: $query1 = new WP_Query($args1); $query2 = new WP_Query($args2); $wp_query = new WP_Query(); ...
0
votes
0answers
54 views

Ajax URL not saving data

I have a submenu admin section under my custom post type which lists the custom posts by category. I have applied jQuery sortable and it all works fine except for the actual saving to the postmeta in ...
0
votes
0answers
18 views

Sorting with custom field and 'comment_count' - orderby

How can I also add comment_count to my existing query? Below query works fine and sorts the archive with highest rating_avg only, I would like to sort my archive using rating_avg first and then the ...
-1
votes
1answer
34 views

Can't sort custom column on user.php by number / meta_value_num?

Everything else works fine but it's still not sorting by number. Would just like to know what I'm doing wrong here Here's the code function add_user_columns( $defaults ) { ...
0
votes
0answers
20 views

Sorting posts with a custom algorithm

What is the best way to be able to sort posts in WP_Query by an algorithm, such as: (total votes) * (1 / hours since submission)
0
votes
1answer
57 views

Sort posts by first letter in the title not by first number

down vote favorite I have a custom post type that's used to display properties on a client website. I am sorting the posts by the title but want to ignore any numbers included in that title. so to ...
0
votes
0answers
21 views

Listing the sites in my network in one page sorted by type

I have a WordPress multi-site installation and in my network I have many sites. I would like to have three lists that list the sites. Each list should show sites in specific city.
0
votes
3answers
48 views

Re-sort get_posts query results

I have a query that pulls fields from the 3 most recent posts for a carousel: get_posts('posts_per_page=3') I need to re-order the results so that instead of it being 1, 2, 3 it is 3, ...
0
votes
1answer
117 views

Sort posts by custom fields value using dropdown menu

I'm trying to sort my posts by a custom field value, called price. Only using numbers in the custom field value. I want that the visitors of the website can sort the posts on price by using a ...
0
votes
0answers
26 views

How to handle sorting and ajax pagination on 300+ items

I have 300+ posts in my db. They are tagged and categorized. When a user nav's to the News page, they see a list of the most recent 10 items (pretty standard stuff). I present a sort bar that sorts ...
1
vote
1answer
60 views

Sort custom taxonomy terms order by both count and name

I am working on a custom taxonomy sorting to make popular terms. The requirement is to sort by popular posts by post count and also I need to sort terms by name to get it alphabetical order. Here is ...
0
votes
0answers
37 views

Page 2+ of taxonomy archives does not recognise sort-order from dropdown

I'm using a custom taxonomy archive and I want the user to be able to organise it by 'latest' or 'alphabetical' along with other custom fields in a dropdown form. Seems to be working fine on the first ...
1
vote
1answer
42 views

How to rank custom post type from score points

I use a custom field with is casino_rank_scorewith stores a point rating for example 4.9 All casinos is stored on custom post type casinos. I need to figure out how to get a rank listing like ...
0
votes
0answers
18 views

Sorting events by meta date value after current date

I have custom post type "Events" and also have custom meta box date, in default mode its working and sorting events with published date, but i want changing events sort by custom date, i've added that ...
0
votes
0answers
52 views

How to sort users by registration date in the admin area of the Wordpress Multisite?

Wordpress Multisite has a sortable Registered column in the list of users in the wp-admin area. This is fine, but it sorts users by user id, not by registered date. How to change this?
0
votes
2answers
23 views

Update meta_key value for a page

I have inherited a WP site where some home page slides are pulled using <?php $po = get_posts( array('post_type' => 'page', 'meta_key' => 'Home Slide', 'order' => 'ASC', 'orderby' ...
0
votes
1answer
34 views

How to order posts by the user_login that corresponds to a meta_value (which is a user id)?

I'm trying to create sortable column headers for a CPT list, but I'm stuck on one piece. When clicking on an "Assignee" column head, I want the list to display alphabetically by the login name of the ...
1
vote
1answer
42 views

Multi-level ordering in Wordpress

I have a collection of posts and first I want to order them by 'name' in ASC order and then order by 'date' in ASC order. How does one go about doing this?
1
vote
2answers
142 views

WP Query orderby meta key natural sort?

I have this code: $args = array( 'posts_per_page' => -1, 'post_type' => 'product', 'meta_key' => 'custom key', 'orderby' => 'meta_value', 'order' => ...
-1
votes
1answer
71 views

Get “wp_get_nav_menu_items” to sort alphabetically [duplicate]

I am trying to return a menu in alphabetical order and not the order set by the user in the backend. I have this code but it is not alphabetical: $args = array( 'order' => ...
1
vote
1answer
202 views

Vertical alphabetically post columns

I need to create a 9 column list that outputs posts sorted vertical and alphabetically. I'm getting closer, but still not there. I have two separate loops I'm working with. The first loop I have the ...
0
votes
0answers
56 views

Sort CPT by first letter of a meta field in a specific range

'I'm working on a way to display member profiles (Custom post type) sorted by the first letter of their last name in a given range. For example all members with a last name starting with 'A' up to ...
0
votes
0answers
93 views

How to sort all admin sub menu items in a custom order

i tried this solution given for this question Re-ordering Admin Submenu Sections to sort sub menu items of all top level menus. But i don't get it to work. I have an array of custom ordering of menu ...
0
votes
2answers
61 views

How to orderby meta_value_num with dollar ($) sign

The custom fields all have prices including $ signs, and a dot as separator. $theQuery = new WP_Query(array( 'orderby' => 'meta_value_num', 'meta_key' => 'price', 'order' => ASC )); All ...
0
votes
0answers
64 views

Sorting meta_value as integer doesn't work

This plugin uses the below chunk of code to print the top 10 highscores. But this doesn't get the list of top 10 scores sorted by meta_value in my WP install $scoreboard = new WP_User_Query( array( ...
0
votes
1answer
23 views

Posts with no meta field do not appear when sorting by meta field

I want to order my posts by a custom meta field "fieldA". I am using the following code: $query->set( 'meta_key', 'fieldA); $query->set( 'orderby', 'meta_value_num' ); $query->set( 'order', ...
0
votes
0answers
20 views

Multisite: List all Blogs alphabetically [duplicate]

Right now I do this … <ul role="navigation" class="sektionen"> <?php $blog_list = wp_get_sites(); foreach ($blog_list AS $blog) { global $blog_id; ...
0
votes
3answers
149 views

Sort Posts By Category?

Googled this for hours, cannot find a solution. On my theme you have a Browse page which pulls all the videos from the Custom Post Type I am working with. If a user makes 30 categories then id like ...
1
vote
1answer
124 views

Sorting Custom Posts on Archive page with pagination

I've got custom taxonomy archive pages with a drop down list that allows users to re-order/sort the posts. It basically waits for the user to select from the drop down then uses array_merge( ...
1
vote
1answer
59 views

Taxonomy Terms - Orderby Custom Value

I have a custom value which is being stored as term_group but in the admin panel I would like to order them by that term group. I'm able to sorta do this through this function, but there's a problem: ...
2
votes
1answer
115 views

How to make orderby 'meta_value_num' OPTIONAL?

$args = array( 'cat' => 5, 'posts_per_page' => 8, 'meta_key' => 'custom_sort_order', 'order' => 'ASC', 'orderby' => 'meta_value_num' ...
0
votes
0answers
85 views

Query category-specific, paginated posts and allow viewer to change sort order

Maybe this has already been asked here, but I can't seem to find a solution, so forgive me if this is a duplicate. I have coded a custom template to display all posts from a category with the ID 36. ...
0
votes
0answers
40 views

How to let users sort list of categories?

In my homepage, I have listed all of categories, under which their posts, are listed like this: Category 1 post 1 post 2 post 3 Category 2 post 4 post 5 post 6 ...
0
votes
0answers
8 views

Sort posts by category priority [duplicate]

I have 5 categories and I would like to show All posts. But I want to show "news" category posts at top of page and after other posts in other categories. How I can do this?
0
votes
1answer
77 views

Sorting posts according to view counts not working

I use the code snippet below to get views count of each post on my sidebar.php . everything works but the sorting does not. also it does not get 4 posts, it only shows 1 post although I've written ...
-5
votes
1answer
75 views

custom sort posts in archive/taxanomy page

I want to override the default sort order of posts in archive and taxonomy pages. what hooks should I implement?
0
votes
1answer
226 views

How to manage a particular “order by” for get_search_query()?

How to manage in the search.php file the order of a posts search query managed with the following code <?php echo sprintf(__('%s Zoekresultaten voor ', 'website'), $wp_query->found_posts); echo ...
0
votes
1answer
99 views

Sorting get_post_ancestors array

I have written this code for my breadcrumbs (i'll give only the part that I have problem with): } elseif (is_page()) { if($post->post_parent){ $anc = get_post_ancestors( $post->ID ...
0
votes
0answers
50 views

Sorting search results

I am trying to develop a better way of searching my website. I want: Results to be displayed by relevance Pages to be listed first, posts should be listed after pages Searched terms to be highlited ...
1
vote
2answers
191 views

Sort wp post title with alphabetically and numerically?

Is there any possible way to sort a new Wordpress post query by the title, but numerically instead of alphabetically? I have some titles that have a lot of the same name alphabetically, then have a ...
0
votes
0answers
20 views

Sort pre_get_posts by multiple Simple Fields meta values? [duplicate]

I'm using the following code to pre_get_posts: function order_programs ( $query ) { // Check if on frontend and main query is modified if( ! is_admin() && $query->is_main_query() ...
0
votes
0answers
20 views

Post Query Glitch Causing First Post to be Out of Order

My problem is that there is a stubborn post at the top of the set of returned posts that somehow isn't sorted with the rest of them. Despite upgrading to 3.9, this issue still persists. For ...
0
votes
1answer
32 views

sort by name (slug) custom post type

What's wrong in this query ? the sortby=name doesn't change anything. $the_query = 'posts_per_page=-1&sortby=name&order=ASC&post_type=mycustom&custom_cat=mycat'; // query is made ...
0
votes
1answer
66 views

Sort loop with query in the link

I want to add some buttons that will sort the post by name asc/desc etc. I want to use query in the link like this http://domain.tld/?orderby=name&order=asc Is this safe to use? Are there ...
0
votes
1answer
60 views

I am having problem sorting custom post type using WP_Query

I have a custom post type called personnel Look at this code: $args = array( 'post_type' => 'personnel', 'posts_per_page' => -1, ); $personnel_query = new ...
0
votes
0answers
17 views

Sort WP_Query by one meta key and post_date [duplicate]

I want to order by post to check for the existence of a meta key ('featured') and include those posts first and as a secondary option I want to sort by post_date, similar to 'sticky' posts on a ...
0
votes
0answers
40 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. ...
2
votes
1answer
33 views

wordpress custom_meta ordering of timestamps

So I have a wp meta query that is handling the searching of events which have a start timestamp, and an end timestamp, I want to return all results within the two dates a user picks in the search. ...
0
votes
1answer
105 views

Ordering posts by custom taxonomy in admin area

EDIT @kaiser - this question is slightly different to the answer you posted in that I am talking about sorting by clicking the column title rather than adding a dropdown to filter by taxonomy term ...
1
vote
1answer
237 views

Trying to sort and display categories(not posts) by custom field: 'order'

I'm a WordPress rookie. I've added a custom field to my "Category" taxonomy. The custom field is "custom_order" and its purpose is to hold a number so that my categories can be sorted and displayed in ...