Questions tagged [sort]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
13 views

Sort custom post type by most current date picker

I'm trying to sort custom post type made with ACF plugin by most current date. Ideally future most current post should be first. Currently, I'm sorting by date, which gives me the earliest post as the ...
0
votes
1answer
25 views

Move some posts to end of sort order, even if there is a sort in the wp_Query already

I have a site that lists properties for sale. I have a custom wp_query, with a sort dropdown I created. This dropdown reorders the posts query by date, price (low-high & high-low) and beds (low-...
0
votes
1answer
35 views

replace text in Sort Box

I have renamed the woocommerce sort options to remove the default "Sort by" preceding all of them. However I would like to rename the text in the box at the top to “Sort by", so that the selected ...
0
votes
1answer
44 views

Rename WooCommerce sorting dropdown options [closed]

How to rename the WooCommerce sorting dropdown options and customise the wording? For example, change "Popularity" to "Best Selling" or "Price: Low to High" to just "Price Low to High" without the ...
0
votes
0answers
41 views

How to sort by multiple values in a nested WP_Query

I am displaying courses, enrollment, along with rooms whose capacities are greater than or equal to the enrollment. This query works, except the 'order' => 'DESC' for courses, and 'orderby' => '...
0
votes
0answers
18 views

How to get ordered fields from repeateble fields group added via Toolset wordpress plugin?

I got 2 fields in group ordered by toolset-post-sortorder meta_key: youtube_id: TeBW-WByzlw 144 163 youtube_id: CEdYPEKDD2E 255 270 This it how it look in DB: This is how I try to get fields: $...
1
vote
1answer
22 views

Sorting category products not working

I am using Avada theme and the sorting of the products on category page is not working. When i click on ascending and descending order the ordering of the products becomes random. Please provide me ...
0
votes
1answer
50 views

Custom post type order by post_title

I got a custom post type called "employees" and this is the query I use with FacetWP (plugin we are using). We want to sort the employees by post_title. <?php return [ "post_type" => [ "...
0
votes
0answers
9 views

Sort query by title in meta value stored as id

How can I sort a query alphabetically by meta value where the meta value has the id of a related post and not its title? I have two custom post types: news and companies. Each post under news has a ...
0
votes
1answer
38 views

How to Sort Products by “Featured” first?

I would like the default sort method of my product archives to display all the featured products first, and then display all the other products as normal. I'm not sure if there is a hook for this or ...
0
votes
0answers
17 views

Ordering search results from a custom post type by name match first (ie. the way order by relevance works for standard WP)?

The DirectoryBox theme by ChimpGroup has a heavily customized search function that searches its own custom post type, 'listings'. Search results are returned in seemingly random order when I specify ...
0
votes
1answer
17 views

How to sort post category using its Description

I Am trying to sort my custom post categories according to its description. I tried below args but it did not work $taxonomies = array( 'post_tag', 'product-type', ); // Add the slugs of ...
0
votes
0answers
18 views

How to make 2 separate pages have 2 separate sorting default options

I currently have my site on a custom default sort with WooCommerce. I need one page to have a different default sort without changing the other. I want this solo page to be sorted by average rating. ...
1
vote
1answer
47 views

Advanced search by two criteria - sort by location and date (ascending or descending)

I have spent a couple of days working on this and I am still not able to figure it out. I am trying to make advanced search filter that sorts posts from a specific category on two criteria: location (...
1
vote
1answer
42 views

Order wordpress taxonomy parent terms by their children count

I need to order parent terms by their children count: function sort_terms_by_children_count ( $terms ) { $sort_terms_by_children_count = array(); foreach($terms as $term) { $count = ...
0
votes
0answers
24 views

Sort posts numerically by converted date format

Updated for clarity: I need to convert the post date format from Y-m-d to mdY and sort by mdY numerically, not by the actual timestamp. My goal is to order the posts by month first, then day, then ...
0
votes
0answers
70 views

Showing and Sorting WooCommerce 'Last Order Date' on Users screen

Need to show and sort the 'last order' date from WooCommerce on the Users screen. I was able to get the date to show correctly, but when I go to sort, Wordpress does not show all the users. The site ...
0
votes
0answers
8 views

Bulk Redirect of posts

Im really hoping you can help me. We need to redirect a lot of posts and from what I've read, using the redirection plugin, to add the old link to the new target. But - I need to redirect only the ...
0
votes
1answer
54 views

Orderby event date (if it exists) or post date (if it doesn't) - how to reorder posts based on meta value OR date

I need a way to sort the posts on my tag and category archives according to the event date (if it exists) OR post date (if it doesn't). I have a combined archive for events and posts, but want to ...
0
votes
1answer
56 views

Order by value of Custom Field using url string

I have a simple dropdown: <select class="dropdown-class" name="sort-posts" id="sortbox" onchange="document.location.search=this.options[this.selectedIndex].value;"> <option disabled ...
0
votes
1answer
31 views

ACF pro: Group teaser by datepicker year and display custom sub fields [closed]

I want to group my custom post types into years. I should look like 2019 Post 1 Post 2 Post 3 2018 Post 1 Post 2 2015 Post 1 YEAR Post 1..n Following this example here: Order and group posts by ...
0
votes
0answers
14 views

Custom shortcode sorted by meta date shows only current year and displays other language in date

I have this snippet in my functions.php. I thought it worked, but I noticed that it shows events only from this year (I have more events that are next year) and also, I can't get the date format to ...
0
votes
0answers
18 views

Wordpress - Products without price go to the bottom when sorting by price ASC

I have a built-in filter in my WooCommerce for ordering my products by price. When I choose to order them by price ascending, the products without price comes all the way to the top. I want these ...
0
votes
0answers
26 views

How to Sort Categories by Parent-Child relationship and not by Alphabetical Order?

I have created a category "Videos". "Videos" as parent category, I have created 2 categories "Teasers" and "Trailers". "Teasers" as parent category, I have created Subcategories "English", "Hindi" ...
0
votes
2answers
76 views

Post filtering is returning blank page

I embedded some code to generate post filters referencing an article at https://premium.wpmudev.org/blog/add-post-filters/ as displayed below: <form class='post-filters'> <select name="...
0
votes
0answers
29 views

sort posts on front end using url query

I am trying to sort posts on my archive page based off a custom field. The custom field is a number. I have the following in my functions.php file - function wpse139657_orderby(){ if( isset($_GET[...
0
votes
0answers
19 views

Store CPT 'Reviews' average ratings to a WordPress DB table or to a DB custom table?

I am working on this portal in which users can review the services (with description and rating) of a cultural place. BASICALLY, I created two Custom Post Types (CPT) with Pods, one is ...
1
vote
0answers
37 views

Taxonomy list : how to order by count percentage of custom post type

I have a taxonomy list. and taxonomy have two custom post types. I want to order taxonomy according to this result. Lets say : A = count of my A custom post type B = count my B custom post type (...
0
votes
0answers
241 views

WooCommerce Custom Query with high/low pricing and paging

I created a custom query in my template to show certain products. I would like to add a sort feature for pricing ascending and descending but have not had any luck. Here is my code on my template: &...
0
votes
0answers
11 views

WooCommerce sorting-order in responsive layout wrong

I have a problem with my main WooCommerce-Shop page: I have 6 products in it, which should be sorted by names as follows: 1, 2, 3, 4, 5, 6 This works fine on a PC or Device with a large display width (...
0
votes
0answers
14 views

show count and sort by curtain post type in taxonomy list

i have a taxonomy list with post count and it sorted by post count. but i want taxonomy list to show only curtain post type count and sort by ount of this post type this is my code function ...
0
votes
1answer
27 views

WP Query with meta queries

I have the following WP_Query: $query = new WP_Query(array( 'post_type' => 'some_cpt', 'posts_per_page' => -1, 'meta_key' => 'active', 'meta_value' => 1, '...
0
votes
0answers
24 views

Woocommerce - Order categories and then pull products by that order

I will give an example what I am trying to make. I have 1 parent and 2 child categories - Sport > Football & Basketball. Also there are 2 custom taxonomy terms (Brands) - Nike & Adidas. Now, ...
2
votes
1answer
1k views

Display sorting options dropdown when using WooCommerce product category shortcode

I have a WordPress site, with WooCommerce. The WooCommerce archives pages as shop display a dropdown sorting filter like in this screenshot: Now in another page let's say example.com/foo On that ...
0
votes
0answers
40 views

Sorting in WP_List_Table class

I am using WP_List_Table class to create tables in Admin panel. I am trying to implement Sorting feature. I am using below code public function prepare_items() { $this->items = $this->...
0
votes
1answer
170 views

How to Sort by Date When Using d-m-Y Format

This question is pursuant to the following - How to Sort Custom Field Admin Column by Date I'm attempting to add functionality to sort a custom post admin list column by a date manually specified in ...
0
votes
2answers
397 views

How to Sort Custom Field Admin Column by Date

I have a WordPress website with a custom post type called 'Courses'. On the WordPress dashboard page listing each course I've added a new column displaying a custom field, which is a date, called '...
2
votes
1answer
40 views

Sort by two dates. Default entry date and custom field if present

I have a custom post type where there is an option to sort by date. There is however a custom date field that allows changing the display date. This custom date field is not always filled. Right now ...
1
vote
2answers
323 views

Sort in WP_Query(), not filter? Is it possible?

I want to query and SORT in WP_Query(). But whatever I do, it only prints posts with meta_key set up. But I want all the results and just sort them. This is my query: $query = new WP_Query(array( '...
0
votes
0answers
28 views

Display and Sort Tags by Last Word / Name

I have a page which lists all tags (artist names) for a certain category along with links to that artists work. Each post only has one tag if that helps simplify things. I am trying to order the tags ...
0
votes
1answer
82 views

Sort populated GravityForms list alphabetically [closed]

hope someone can help a newbie because I'm stumped on how to do this. I've got the following code in my functions.php that populates a GravityForms form "checkbox list" of products. The user selects ...
0
votes
0answers
8 views

Is there a way to execute a function whenever Gutenberg Blocks are rearranged?

i'm having the following problem: I have created a grid component which uses a binary packing script (packery by metafizzy) to fit its child blocks depending on their size. To improve the editing ...
0
votes
0answers
13 views

Is it possible to autosort tables in the visual editor?

A client asked if the tables in his Wordpress editor could be sorted alphabetically automatically. He asks because the tables are quite long and it would be easier for him to edit them this way. (I ...
0
votes
0answers
74 views

WooCommerce product sorting VERY slow

I have 2800 products in my WooCommerce store. Trying to use the All Products > "Sorting" utility in the backend to edit the desired order for them to appear is excruciatingly slow. Even if I filter ...
3
votes
3answers
794 views

Filter admin columns by custom post field value

I have a custom post type called dogs. Within the Add Dog interface, I have a radio-button group that gives choices for color, which are added to the new dog post as meta data. There are about five ...
1
vote
1answer
146 views

Admin multiple column sorting

This question seems simple enough, and I'm surprised that I don't find much while searching Google to find an answer. The only thing I've found is a pro plugin, so far. I'd just like to be able to ...
1
vote
1answer
180 views

Changing WP_Query params with url Query Var

:) I've used WP_Query to display there posts (travels) here http://boost19.delavec.si/wordpressP/produkti/ So... I've got this WP_Query that is looping through my custom posts <?php $paged = (...
-1
votes
1answer
38 views

Sort by promo code used woocommerce admin panel [closed]

I work on Woocommerce / Wordpress and I'm new, I want to custom my Woocommece orders list admin panel by adding the used coupons inside it, but I've got a little problem when i click on promo field ...
0
votes
1answer
89 views

how to develop a filter in wordpress to let the user filter the page content depends on the date (newest to oldest etc…)?

how to develop a filter in WordPress to let the user sort the page content depends on (alphabetically, newest to oldest and oldest to newest etc...)? I’d like another drop down tab on the left side ...
0
votes
0answers
95 views

Native admin table with search functionality: sorting by columns does not work

I display a WP_List_Table on a submenu_page and offer a search function, which works. However, if I sort by a column within a search result, all records are displayed again. I really don't know why ...