Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [order]

The tag has no usage guidance.

0
votes
0answers
18 views

meta_query orderby sort multiple keys

I'm trying to read the birthdays of the users in my database through custom fields that have been added. Displaying the current months is easy but I am trying to capture the current month(remainder) ...
0
votes
1answer
27 views

How to always display a specific post from the search result first

I created a search filter that displays posts randomly, and I wonder how can I always display a specific post item in the first position of the search results and display the rest of the items ...
0
votes
1answer
25 views

Debugging wp_query orderby for taxonomy

I cannot seem to find where WP_Query adds the orderby clause to a SQL query. I am using this code: function wpd_team_taxonomy_queries( $query ) { if ( !is_admin() && $query->is_tax( 'team'...
0
votes
0answers
11 views

Query Order By Number Variable From API

Trying to order the query by a number variable $total that is a storing an api containing a number. My goal is to output an ordered list with the number ($total) sorting the list. I've looked around ...
0
votes
0answers
12 views

How Can I Save This Re-order action?

I have a code that I'm working on to enable a user to manually order posts in a custom post type, a lot of the code I basically copy-pasted from an already-existing plugin that has this functionality, ...
0
votes
0answers
20 views

How to edit “Processing” order in Woocommerce properly [on hold]

I have issue with editing "Processing" order in Woocommerce. Basically, this is what I have found online that could work: https://businessbloomer.com/woocommerce-edit-orders/ Still, there are one ...
0
votes
0answers
13 views

How to get_comments() ordered by date and parent?

So my starting point is: <?php $comments = get_comments(array( 'post_id' => $post->ID, 'status' => 'approve', 'type'=>'comment', '...
0
votes
0answers
32 views

WP Query to order posts with a specific meta value first

I am trying to write a WP post query to get all posts which have a certain meta key, but with those which have the key set to a specific value to show first. The query modifications are in a ...
0
votes
1answer
11 views

How to order multiple custom post types with same taxonomy by date

I am using this code to display list of multiple custom posts by same taxonomy and order them by date publishing. But somehow it mixed the order. The live example: https://planetaudio.hr/novo-u-...
1
vote
1answer
154 views

Order by summing multiple values

In a custom post type (products) I want to order products by summing multiple values based on user selection. I use custom taxonomies to filter the products. I could use the orderby meta_value but ...
1
vote
0answers
16 views

Sort WP posts by span value

on website I have multiple posts that contains specific span. Example: *Post 1: 4 Post 2: 3 Post 3: 7** Is it possible to order posts by this span values?
0
votes
0answers
9 views

WooCommerce change product in order

It's less a coding question and more of operating question. When I am trying to edit an order and I want to add a variation, I can only add the variable product. For example, if I want to add "...
1
vote
0answers
21 views

Understanding the orderby in WP_Query?

For quite a while I have been trying to query posts, with 2 different meta_queries, and order them differently. I followed the WP codex. Recently I have found out that I have been mistaken this ...
0
votes
3answers
56 views

WP_Query not resetting after wp_reset_postdata

I have this custom query: if (isset($_COOKIE['myCookie']) && $_COOKIE['myCookie'] == $f_r) { $args = array( 'posts_per_page' => 4, 'nopaging' => false, 'order' => ...
0
votes
0answers
32 views

Order 2 meta_queries differently in WP_Query?

I have a custom WP_Query with 2 different meta queries. I want to order the results of both queries differently. The first meta_query I want to order by a custom field (high integer - low integer). ...
2
votes
4answers
151 views

WooCommerce 'all' orders no longer being displayed - how may I debug/fix

I've just noticed that we seem to have a bug with our store. The 'all' orders selection is showing as empty but the other sub catergories such as completed, on hold and pending etc are there. I'm ...
0
votes
0answers
35 views

Adding additional information to Admin Order Preview

Looking at adding the actual shipping costs of an order to the order preview pop-up. I think we have to use add_action with woocommerce_admin_order_preview_end and maybe even using add_filter to ...
1
vote
1answer
27 views

Show listings from Impress Listing plugin in random order using taxonomy and terms

I am not able to get the listings to show up. I have verified the slug for the post type and the taxonomy. This code I know works because I have used it for other post types and taxonomy's. Any ...
0
votes
0answers
11 views

Need a Plugin for Sorting Specific Category Posts within a Static Page

I am NOT a strong PHP coder and mainly create sites using plugins and custom CSS which I am strong at. I have a page listing posts from a specific category. The page is built using Elementor Page ...
0
votes
0answers
57 views

Woocommerce 'order_by' random with 1 hour seed refresh

I need my woocommerce products to display randomly. My products are actually people and the random element is so different people get seen on the first page so no-one is favoured. So, I have ...
0
votes
0answers
33 views

Featured posts reordering without plugin - Newspaper theme

I am using Newspaper (child) theme where the 2 carousels display the 11 featured posts (first 5 in the main carousel and the following 6 in a secondary carousel). We used to use a plugin to reorder ...
0
votes
0answers
27 views

In get_terms, orderby meta value not working with child_of

Here are my terms query and args. $termArgs = array( 'taxonomy' => 'category', 'hide_empty' => true, 'orderby' => 'meta_key_num', 'meta_key' => 'belCount', '...
0
votes
1answer
26 views

Wp Query sort order from custom MetaBox

I am trying to sort a list of post based of the meta_key deal amount, which would be to display the highest deal first and work its way down to smaller deal amounts. The deal amount would be anywhere ...
0
votes
1answer
12 views

Order management including recurring orders on woocommerce

I've been trying to find a good way for handling order management as I have some recurring payments on my business. I need to set up a system that informs me how many items I should have in stock ...
0
votes
0answers
18 views

Sorting with meta_query and multiple, optional meta keys

I'm trying to sort a custom post type by 3 properties: Meta Key: is_featured Meta Key: is_primary Title The two keys are boolean ACF items, and are both optional, so most of the posts don't have the ...
0
votes
0answers
44 views

WooCommerce Order Action In New Page

I have added an action button to the orders page and I want it to open in a new window. This is my code: if ( $order->has_status( array( 'processing' ) ) ) { // Get Order ID (...
0
votes
2answers
57 views

Orderby Title not working

When I'm trying to sort my blog posts or my woocommerce in alphabetical order nothing changes. If I access the /?orderby=title-asc or ?orderby=title-desc it brings me the same results. Any sugestions?...
0
votes
0answers
163 views

Woocommerce: sort by price and sku - combination of meta values

I'm trying to sort products by price, but have them sorted by sku and not by id for a specific price. So if there are 10 products with the same price, they should be ordered by sku instead of id. I ...
0
votes
0answers
42 views

Woocommerce merging cart and checkout page together

I've go an idea to merge cart and checkout pages into one. Doing it by moving files produced errors but i found a simple, yet effective solution. In order to make cart and checkout page as one, all ...
0
votes
0answers
20 views

Order by date with more than one meta key in Wordpress query

I have a list of events and they all have either a 'start date' or 'date'. I am trying to list the events in order using either field depending on which is filled out but am having no luck. I tried: $...
0
votes
0answers
35 views

Why does this incorrect pre_get_posts meta_query work for sort order?

I've got a fairly complicated post type archive page that I need to order by two meta fields and the post title. To do that, I'm using pre_get_posts with a meta_query that simply tests for the ...
0
votes
0answers
69 views

WP Query. Ordering posts by another post types meta

I have a custom post type called BID which contains a users bid (similar to freelancer.com, upwork, etc) However I need the BID results on the page to be ordered by meta stored in a users profile, ...
2
votes
2answers
41 views

Ordering terms before displaying posts

My question is close to other questions, but I dont' have enough reputation to comment. I'm working for a restaurant and I 'd like, for my menu page, to organise my posts "meal" under terms "...
0
votes
0answers
7 views

specific post always at 3rd position in a category page

I have already searched but found nothing useful. im Develop a Wordpresstheme. I would like to have a post always located at 3rd position in a category page. Another at the 6th place. At first I ...
0
votes
0answers
11 views

Selling some product individually

I am working on a woocommerce website. The website will sell some high-value products like motorcycles, cellphones on EMI. We want some products like these to be the only product in the order. How can ...
0
votes
1answer
33 views

Stylesheet Enqueue Order and Best Practices

i would like to do the following: customize a theme to my likings for use on several sites and installations. so i can make "global" changes (via own plugin?) then i would like to have a site ...
1
vote
0answers
51 views

get_adjacent_post() returning weird results

I am using get_adjacent_post() function to display links to a previous and next post. It is a custom post which also has a custom taxonomy. This is the code I am using: $prev = get_adjacent_post(...
0
votes
1answer
42 views

Sort loop by title doesn't sort single digits like human would

Post titles have numbers from 1 to 50 and i want to sort them in order, it's not possible to use 2 digits, the sequence goes like: 1,2,3,4,5...50. So i use: $query->set('orderby', array( 'title' =...
1
vote
0answers
232 views

WooCommerce order complete email logic

Can someone helps me to understand the logic of WooCommerce for sending email on a completed order? If I'm not wrong, the mail is send when the order is marked complete, but I'm not able to find the ...
0
votes
0answers
17 views

Sorting meta_query of custom post type

I have 2 custom post types Transit and Colors, connected with a relationship - as a transit post has a custom field to select a color post that it will belong, that stores the Color post ID. I ...
1
vote
2answers
115 views

Display posts from #6 to #20 on archive page

My client shows his 5 most recent posts (excerpts) on the homepage followed by a "read more" link. On archive page he does not want to display the 5 most recent post again but posts from #6 to #20. ...
0
votes
0answers
96 views

What is the ‘real’ way to show purchase notes on the order details page?

Can someone please outline the proper, working, way of displaying purchase notes? For a long time, I have been getting them to display correctly on my order details page (thankyou.php) however the ...
0
votes
0answers
11 views

Order by 3 custom fields in archive Woocomerce list

I'm trying to order the products in woocomerce archives pages by 3 custom fieds, my code is: add_action( 'woocommerce_product_query', 'imcar_custom_product_query' ); function ...
2
votes
1answer
308 views

Display custom post types with custom date field value (before today) & order by custom date field

I'm trying to display custom post types with custom date field value being before today. It works OK for showing posts before today, but the order is only based on post date. I want to have the result ...
0
votes
1answer
182 views

Add button linked to single product page on order detail page

I have write a code on functions.php so when customers click a button on order detail page, redirected to product page and review tab of the product they bought. But as a novice coder, I can't get the ...
0
votes
2answers
61 views

(Solved) WP_Query ($ args) -> How to sort letters and numbers within the same array

I'm developing a system where I have a Deck presentation. I have a field that takes the post by the 'copas' type of card being within the 'meta_value' array specification, and I would like it to be ...
0
votes
0answers
24 views

Woocommerce canno't print product page

I try to print the product details page from a Woocommerce instance. But when I press CTL+P I get a Blank page. How can I fix this issuse?
0
votes
0answers
28 views

Add another email to a customer to recieve procesed order woocommerce

I need your help to create a field that I put another email from a customer. I need that customer to receive the order and with the other email receive the same order. I tried this code: ...
0
votes
1answer
108 views

I Changed the Menu Order, But the Page Order Didn't Change on Front Page

First-timer here! I'm trying to change the order of pages on my boardgame webpage, as displayed on the top banner www.mangakagame.com . Basically, I've used "Edit" in the Dashboard and adjusted all ...
0
votes
0answers
53 views

stop looping of woocommerce admin order actions

this is my code below to add my own action into the admin order page.But what happen, it is repeated several time.Thanks in advance for any help. public function ...