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
5 views

WooCommerce: Force coupon for existing/registered customers

I have some specific regular customers for which I have particular coupons, like 10%, 15% etc. I want the coupon codes to be fixed in their useraccounts so that they do NOT need to enter it during ...
0
votes
0answers
11 views

Formatting product prices in email orders

I’m trying to format prices in case of Indian Rupees. Below is my code and it works in case of email order on hold but how to make it work in case of order-complete? //Indian Currency Formatter ...
0
votes
0answers
12 views

How to sort posts based on likes using Likebtn-plugin

On Likebtn-plugin homepage ([https://likebtn.com/en/wordpress-like-button-plugin#sort_posts_by_likes][1]) they give this code to input in a template file, e.g. index.php, archives.php, page.php, such ...
0
votes
0answers
7 views

separate the order into two export file

I’m looking for an export solution to separate the order into two export file based on the supplier’s product for each of them. Example: I receive an order, then I have to send two separate orders to ...
0
votes
0answers
18 views

Unable to ORDER BY numbers

I am using WPTables to display data in a mySQL database, it all works fine and without issues, the problem is it sorts oldest first, I need to sort by newest first, here is an example: http://...
0
votes
0answers
12 views

WP_Query orderby meta_value Speed

I currently sorting my posts using this code: function main_query($query) { if ( is_search() || is_home() || is_front_page() || is_archive() ) { if (!is_admin() && $query->...
0
votes
0answers
13 views

sort title descending with title with number

please help me, i have title like this '1-nen A-gumi no Monster Chapter 2' '1-nen A-gumi no Monster Chapter 10' '1-nen A-gumi no Monster Chapter 2' '1-nen A-gumi no Monster Chapter 1' '1-nen A-gumi no ...
0
votes
0answers
13 views

Cancelled orders move to Trash automatically in Woocommerce - how to disable?

I have a Wordpress 5.4.1. website, with Woocommerce 4.1.1. installed. It seems that orders which have the status "Cancelled" move to Trash automatically after one month passes (from the order date). ...
0
votes
0answers
12 views

Changing cache update rate

Im using mylisting theme in wordpress. in listing ordering, one option is Random (cached and updated every few hours). How can I adjust the update rate from few hours to few minutes ? or even remove ...
0
votes
0answers
9 views

order terms by count

Is there a way to order my term list by the terms that got more posts related? Im trying this, but without success: <?php $terms = get_terms( 'jobinformationcat', array( 'orderby' => 'count'...
0
votes
0answers
13 views

Sorting events by values of date and time from custom fields, when they used to select only past events, goes wrong

I think it works perect to select posts, that 1) date in custom field is less than today 2) if it's today, i check if time is past. But it does not sort them in right order. It's sorted by date, but ...
0
votes
0answers
14 views

How to add product thumbnail on orders list on backend?

I added product thumbail on cart with this function getCartItemThumbnail( $img, $cart_item ) { if ( isset( $cart_item['image'] ) ) { return '<img src="' . $cart_item['image'] . '" /&...
0
votes
0answers
12 views

Custom order of posts in wp_query and different taxonomies

Say I have the following: Post IDs: 1,2,3,4,5,6,7,8,9,10 Category: A, B, C, D, E I want to create A page that will contain Taxonomy A and have the following Post IDs in the following order: 4, 6, ...
1
vote
1answer
40 views

Create WooCommerce new order with specific ID

I have a possibility to clone orders for each product. But I need to make a custom order ID with parent ID and add some number or letters for it. Depends, from quantity of cloning numbers in parent ...
0
votes
0answers
22 views

Related posts ordered by taxonomy

On my single post page, I display 4 related posts based on 3 custom taxonomies products, artists, and product-category. Everything works fine with the code below. BUT: Right now, with this code, the ...
0
votes
0answers
16 views

Wordpress If I specify meta_key, order, orderby in post $query_args then can't filter post

I want to order jobs by featured first, it's working but then I can't filter posts. I specify meta_key, orderby, order in the query_args and display posts (this is working): $query_args = array( '...
0
votes
1answer
26 views

How to order taxonomy terms by most recent post?

I have a list of terms showing in slug order but I need to order them by most recent posts, so it will be changing depending on what term has the most recent entries... Is there a way to do so? I ...
0
votes
0answers
30 views

woocommerce order filter w.r.t delivery date

does anyone know how can I filter my woo-commerce orders according to the delivery date? help needed ASAP as I have made delivery and shipping date with custom fields and tried date picker but it only ...
0
votes
1answer
19 views

List taxonomy terms plus their latest post ordered by post date

I have the following code: $custom_terms = get_terms('columna'); foreach($custom_terms as $custom_term) { wp_reset_query(); $args = array('post_type' => 'post', 'posts_per_page'=&...
0
votes
0answers
24 views

WP_Query random ordering not working since 5.4

My random sorting of custom posts isn't working since I upgraded to WordPress 5.4. This is the query that I am using: $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args ...
0
votes
0answers
10 views

Rogue order stuck in woocommerce

I am running woocommerce 4.01 and on the left admin bar it states 2 orders, but when I click into order there is actually only 1 order. If I click on the link 'Orders' it shows 1 order in the main ...
0
votes
0answers
11 views

How can I add the address fields labels of the checkout page in the order email?

I need to make the address to be clear in the order email in woocommerce, How can I add the fields label for each field in the order email? Thanks,
1
vote
0answers
39 views

WP_Query: Group events by year, sorted DESC; then by date for each year group, sorted ASC

I'm trying to set up a query for an "event" custom post type that groups posts by year, with a heading for each year, in descending order; then, for each year group, ordered by date in ascending order ...
0
votes
1answer
34 views

wp_get_attachment_url images in wrong order [closed]

I have this bit of code in my xml feed and it's picking up the images in a different order than it is in the WordPress post. https://i.imgur.com/xmetEa6.png Here in the admin area I can drag the ...
0
votes
1answer
35 views

WordPress Query custom ordering by temporary variable

I have created location proximity functionality. I have a WP_Query loop created for a custom post type called Instructor. Each instructor has an address, so if someone enters a zip code it calculates ...
1
vote
1answer
42 views

Meta query with order by another custom field

Edit: I will try to explain in detail my problem. I am working on a portfolio site. There are a few custom post types: Projects, Publications, Exhibitions, Lectures and Slides. Home page consists of ...
0
votes
0answers
25 views

Order custom metabox in diferent page templates

I have multiple pages created with a linked custom template. I have installed the toolset plugin that allows creating custom fields and linking them to page templates. Each page has different groups ...
0
votes
0answers
48 views

Orderby if between two meta fields

I am trying to orderby my CPT if the current time is in between two meta fields. (i.e, the current_time() is between two time fields.). meta_query returns only the posts that are between the values, ...
0
votes
0answers
14 views

meta_query check multiple date formats

I am trying to query a custom post type that has a meta value (DATE) that are equal or greater than today. My issue is that some posts have the date stored in the "Ymd" format and others have "Y-m-dTg:...
-1
votes
1answer
11 views

Add post order like page order

There is an order field when editing pages, so you can easily rearrange them, this is missing at posts, I`m thinking that there must be a simple scrip that adds this functionality to posts too. I ...
3
votes
3answers
105 views

Query posts ordering by title, but ignore " and special characters

I use following function to get my custom posts ordering by title $posts = get_posts( array( "orderby"=> "title", "order" => "ASC", "post_type" => "my-custom-post-...
1
vote
0answers
23 views

Weird orderby => post__in issue

I seem to have run into a sort of odd issue with WP_Query post__in I can't quite figure out. ANY help is appreciated! Goal/Progress so far: Overall I want to merge two arrays and use the merged ...
0
votes
0answers
22 views

Modifying category order

I am working with a directory style wordpress theme that displays categories in masonry style columns with their posts listed under each category title. The categories are appearing on the front page ...
0
votes
0answers
46 views

Problem adding action to change order to 'on-hold' status

I am trying to add a button which depends on the order status, will let the shop owner to change to next order status according to a flowchart I have planned. I wrote the code and all status change ...
0
votes
0answers
33 views

Ordering by ACF custom field vaule

I'm using ACF field for post ordering. Now I have positions for 1-5 for post display, so you can select on which position post should appear. Only thing that I can't achieve right now for example is ...
0
votes
1answer
49 views

Custom order revolution sliders post base slides as inserted in Specific Posts List field

My homepage shows about 10-20 post that are manually selected in a slide. I have used Revolution slider. There is a field Specific Posts List field Where I have inserted post Ids 16427,16557,16822,...
0
votes
0answers
14 views

Send items with blank meta query values to bottom of the list

I have the following code which loops through some custom post types and orders them two custom meta values - firstly by start date and then secondly by duration. This works fine - except for tours ...
0
votes
1answer
30 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
17 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
19 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
63 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
34 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
17 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
33 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
30 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
90 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
39 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
37 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( '...

1
2 3 4 5
14