The tag has no wiki summary.

learn more… | top users | synonyms (1)

0
votes
0answers
9 views

how to sort post in admin column by recently

i have created custom post type my problem is: in admin column, posts are sorted by ID how can change it to date. In other words, i want to sort post by recently
0
votes
0answers
17 views

Sorting posts to make those with post thumbnail show up first

I am trying to sort post with If have post thumbnail list posts show first(i need the posts without thumbnail to show after it) by title. $args = array( 'post_type' => 'post', 'meta_key' ...
0
votes
1answer
19 views

wordpress sorting using array merge by price in ascending order but price with 0 must be show last

I'm using below code to filter the query on page and sort the post in ascending order by price. I'm getting desire output but my concern is , i want all price with 0 at last. <?php global ...
1
vote
0answers
33 views

Sort alphabetically by custom field

I'm trying to change the sort order of a custom field in a custom post type. I want it to be be alphabetical by the 'location' name. It's sorting by location, but not keeping them in alphabetical ...
0
votes
1answer
20 views

Query Set Order By Author

I am attempting to orderby the author_name when you click on the Author arrow on a list of tickets. When you click the arrow, the names are ordering by something I cannot identify. I want them to ...
0
votes
1answer
43 views

Sort Custom Post Type by Category ID then Post Name

I'm creating a custom post type archive page, and I have the posts sorted by category. However, I need the categories to be listed by ID, and the posts to be listed by name. Here is what I have so ...
4
votes
1answer
82 views

How to get order of posts?

How can I get the order through which the query is done? For example, my woocommerce product archive page is querying by ordering according to the order_by select box (as seen below). How can I get ...
0
votes
0answers
21 views

Sorting posts alphabetical that have single digits

I have post titles that are like this: Episode 1 Episode 2 Episode 6 Episode 10 Episode 14 I try to list posts alphabetically but it ends up showing like this: Episode 1 Episode 10 Episode 14 ...
0
votes
3answers
36 views

Order posts randomly, not by date

I'd like to know how to order by "random" instead of by "date". Can someone help me modify this so it gets posts randomly instead of by date? $posts = ...
0
votes
0answers
51 views

Sorting is not working in wordpress WP_Query

i have created a page where i am sorting the post according to the views. Here is the query <?php $temp = $wp_query; $wp_query = null; $wp_query = new WP_Query(); ...
0
votes
0answers
32 views

initial sort order for a sortable custom column in admin

I have created a number of 'views' column in the admin area of my posts. There are several tutorials for this and I did in fact use a number of these to arrive at my end result. It works as expected ...
0
votes
0answers
58 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
85 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
25 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
49 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
29 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
110 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
24 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
62 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
332 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
35 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
94 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
47 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
72 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
29 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
80 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
30 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
42 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
44 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
270 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
108 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
252 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
92 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
128 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
70 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
94 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
368 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
176 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
72 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
158 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
107 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
43 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
87 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
93 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
279 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
147 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
53 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 ...