Questions tagged [order]

A parameter used in queries to specify the type and direction of sorting.

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

WP_Query of custom post type sorted by meta_key has unexpected results

I do not understand why my code outputs the events in a seemingly random order. It's not sorting by the start_time as I would expect. <?php $args = array( 'post_type' => '...
0
votes
1answer
15 views

Display custom posts, ordered by most commented, without duplicates

I would like to display custom posts in template, they have to be ordered by most commented and without duplicates on the same page. This is the code that I have for now. $args = array( 'post_type' =&...
0
votes
0answers
18 views

Output taxonomy by picked order

quick question... I have a taxonomy associated with a custom page type. When choosing them in the custom page I want to preserve the order by which item I choose first. How can this be achived? Or ...
0
votes
2answers
15 views

Sort by an ACF field in a tax_query

I do not find the solution which must surely be surely simple. (I'm new to WP) I have an ACF field named "partners_order". I would like to sort it in ascending order (ASC) here's what i tried <?...
1
vote
0answers
24 views

WooCommerce quick checkout form? [closed]

I have a site powered by WordPress and using WooCommerce Plugin. I want to add a custom quick checkout form on a single product page. For reference, see the image Quick checkout form: Can I make a ...
0
votes
0answers
10 views

how can my customers view their purchased products history like an invoice in a specific page on Wordpress

how can my customers view their purchased products history like an invoice in a specific page on Wordpress. I need help please if someone can help me let me know. I have searched allot ways to solve ...
1
vote
1answer
10 views

Order RSS content by an advanced custom field value

I have created a custom post-type called "event". For this custom post-type I created an advanced custom field called "event_date". Now I am trying to display the list of my events in a RSS feed. ...
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: $...
0
votes
0answers
10 views

Ordering simple elements within the CMS

I have a set of elements all using a piece of code as a template; $elements = array ('element1', 'element2', ... 'element n'); And then foreach ($elements as $element) { <div class="template"&...
0
votes
0answers
23 views

Sort posts of a particular category based on custom date field value, and display in ascending order

I'm working on displaying a listing of posts that have a an advanced custom field Date Picker, and I need to display all upcoming posts in ascending order. So far I can get the wp_query to show all ...
0
votes
0answers
18 views

Order status still “Pending Payment” after successful payment (Custom payment gateway)

I was develop a custom payment gateway for woocommerce, everything is good but after payment success the order still "pending payment" In the __construct() function I check for payment provider ...
0
votes
0answers
11 views

how to find the right hook to change the woocommerce order refund textbox

im trying to change this text box into dropdown box, but i cant find the right hook, or can you help me how to find a hook for this one, heres my sample code add_action( '...
0
votes
0answers
31 views

Meta query orderby meta_value_num sorting by role first

I want all of the results to order by meta_value_num, but it's ordering by role first. How do I get them to ignore the role order? Here's my code: $user_query = new WP_User_Query( array( '...
0
votes
0answers
23 views

WP_User_Query Orderby Not Working

If I use the following code, I can retrieve users in the correct order: $user_query = new WP_User_Query( array( 'role__in' => wp_parse_list( $atts['userrole'] ), 'meta_query' => ...
0
votes
0answers
29 views

Change the customer's name to a link on an order management page

Inside the admin control panel, on an order page where I see all the details of the order. I see a list of things: customer name, phone, address, email, etc. I'm trying to change the client's name to ...
1
vote
0answers
15 views

How to do WP_Query with two meta fields with orderby clause

The goal is to first try to order by the custom meta field and if its not found then do order by the post date. Here is the query I did so far, but its not working. $args = array( 'post_type' =&...
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
2answers
36 views

Order custom taxonomy hierarchy

I have some custom taxonomy for regions. Commonly it would look something like this. USA (parent) - Arizona (child 1) - - Phoenix (child 2) however, there will be cases where it will only be like ...
0
votes
1answer
27 views

How to save one API response to WooCommerce order meta data

Have one custom checkout field email type that validates if the email exists or not in a remote server. I sent JSON data to the remote server with this field. If email exists JSON response typically:...
0
votes
0answers
22 views

I want to get latest one post of a particular category

I want to get the latest one post on counting View Count. Latest I have tried this but didn't get the result : $popularpost = new WP_Query( array( 'post_type' => 'post', 'posts_per_page'...
0
votes
0answers
14 views

SEARCH QUERIES - REVERSE OUTPUT

When I perform a search on the WP admin side for my custom post query I am returned with the most relevant queries first. Great However, performing the same search on the front end of the site and I ...
0
votes
0answers
15 views

Using date stored as custom field to order posts

I have a custom post type "travel" and a custom field "data" (date format j F) and I would like to see all the posts in order by the custom field "data". I think I have to transform it into timestamp ...
0
votes
1answer
29 views

query posts custom field calculation value

I have a front-end form whereby users create a post and input 3 numerical custom field value` as part of their post. These 3 custom fields are then calculated and the result is displayed in the post....
0
votes
1answer
21 views

order custom post type posts by custom date

Trying to order posts by a custom field, where a date i stored. The date looks like this "03.10.2019". All of the below function works properly, but the posts are sorted by post date, not custom field ...
0
votes
0answers
20 views

Multiple orderby date arguments

I've had good luck with using multiple orderby arguments in the past, but now that I'm trying it with dates I'm wondering if there's something I'm missing. I'm trying to order some posts by an ACF ...
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
1answer
8 views

How can I order these pages in this navigation bar on this old wordpress theme?

It's using a superceded theme with no support. Even so, the theme has been working great for about a decade... Here is the site: https://www.vertebr.ae There is no menu to organise in the ...
0
votes
1answer
20 views

Order posts by meta key ( Using ACF )

Hey I am using ACF in media library and want to sort media by meta key (that is actually created by ACF). BUT it is not working. Here is the code: $gallery_imgs = get_posts(array( 'post_type' ...
0
votes
1answer
54 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
25 views

query posts with selected post ids first

Is there a way I can get most recent posts with a couple of posts I specify by post ID listed first? According the docs, the order and orderby parameters may be passed as an array, so in theory I'm ...
0
votes
0answers
62 views

display order in admin with some selected order status and provided admin in woocommerce

I have two types of admin for order management. 1. Administrator 2. Delivery Boy Admin Administrator have all capability Delivery boy admin should be view and change only those status whose have ...
0
votes
0answers
14 views

Sort posts by number of times tagged [duplicate]

Let's say I have a custom post type Books, and I tag the books with a custom taxonomy "Person". The taxonomy contains the name of a person and basically means the person has read that particular book. ...
0
votes
0answers
12 views

order search results when query altered with wildcards

this is specific case for "Devanagari" fonts/language. I have a small encyclopedia type website having 18000 records in "Marathi" (a local state language in India). Marathi uses Devanagari script. ...
0
votes
0answers
36 views

WordPress Admin - Automatically Sort Custom Posts by Custom Field Date Value in d-m-Y Fomat

I have a custom post type called 'Courses'. I'm currently trying to automatically display them in the dashboard 'Courses' post list sorted by a date value specified in a custom field. The date value ...
0
votes
0answers
29 views

how to complete order status automatically after paypal payment received

we are using paypal payment gateway for payment we want autocomplete order status after payement received how we can complete order status automatically is there any plugin
0
votes
1answer
179 views

How to get woocommerce selected variation from order object

Iam trying get selected variation from order. global $order; $items = $order->get_items(); foreach( $items as $item ) { $product_id = $item->get_product_id(); $product = wc_get_product(...
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
1answer
11 views

Order by meta date with a thousanth of a second defaults to post order

I have a custom post type query: $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $args = array( 'paged' => $paged, 'post_type' => 'my_custom_post_type', '...
0
votes
0answers
7 views

How to replace name of shipment method with another value in dashboard / order?

I've created a shipping method that fetches a servicepoint (location/store) when entering street and postal code. That works at the frontend. The shipment method is called DHL Sweden. When I go ...
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
1answer
160 views

Taxonomy list. Order by a specific custom post type count

I have a custom taxonomy and two custom post types (A and B post types). I created a taxonomy list and this list also display B posts type count of taxonomy. Taxonomy list is ordered by post count. ...
0
votes
2answers
39 views

wp query multiple values > display a specific value first

I have a query that get relationship fields for multiple ID. I get the ID of selected item, and merge it in an array with other ID's ex : my page relationship ID = 5 my other pages ID in array = 6,...
0
votes
0answers
55 views

Sorting Tag Cloud by Popularity

So I have the default Wordpress Tag Cloud Widget on my sidebar/footer and I found the following code to limit the number that it's showing because it took up a ton of space. This code however is not ...
0
votes
1answer
53 views

line order number start numbering from second line (SOLVED)

if(is_tax()) { $currentTermType = get_query_var( 'taxonomy' ); $cat_icon = get_field('logo', $queried_object); ...
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, '...
1
vote
1answer
167 views

Change default ordering of taxonomy terms - pre_get_terms

I wanted to change the default taxonomy terms order by its 'term_order' value instead of 'name' in admin side. So I tried something like below. But it doesn't work and php memory exhaust. function ...
0
votes
0answers
35 views

Order Element By Custom Field in Wordpress

I'm working on wordpress and I want to order my post by rating. I'm new with it, and I need some help. I tried many things, but seem it's not working :/ My Wordpress Custom field which contain the ...
0
votes
0answers
14 views

Dokan Muti Vendor Plugin - Change commission of vendor after order has been synced

I did not set the admin commission (read: it was 0%) when the website went live so right now no vendor has any commission. I have around 120 orders and I need to set commissions each vendor received ...
0
votes
1answer
85 views

How to order WordPress Rest API data

I am pulling in some data via the Rest API: https://legalsecurityforum.com/wp-json/wp/v2/speaker?include[]=3116&include[]=3249&include[]=3170&include[]=3416&include[]=3181&include[...
2
votes
2answers
413 views

Meta query interfering with orderby relevance

I'm trying to re-order the search results using the pre_get_posts hook and set the orderby parameter to relevance. I also want to put priority posts, which is based on post meta _prioritize_s to be ...