The tag has no usage guidance.

learn more… | top users | synonyms

3
votes
1answer
28 views

Sorting posts by multiple values, combined

In this image, 1. The Black letters are default post titles 2. The number before the 'of' is a custom field. 3. The number after the year is the post's published year Now I want to sort this ...
0
votes
0answers
41 views

Order ascending is ignored in meta query?

I'm using pre_get_posts to alter my main query and attach a meta query to it. This is on a woocommerce products archive page (...not sure if that would make a difference). function has_upcoming_date(...
1
vote
0answers
19 views

How to select N number of products and display it randomly in Woocommerce

I have a woocommerce setup with about 10,000 products, i would like to display all the latest products on the home page so that i can have N number of latest products from each PRODUC TAG displayed in ...
-1
votes
0answers
19 views

How to hook for disabling sending processing order email notification if order total value is 0 - Woocommerce?

I need to disable woocommerce sending processing order email notification if order total value is 0. I also tried: : add_action( 'woocommerce_email', 'unhook_those_pesky_emails' ); function ...
-1
votes
0answers
11 views

Product Query by meta_value and published date

I've seen some similar posts here, but this none that gives me really the answer. I have products that I want to order by their meta_key '_sku'. The SKU can be a number (ex. 1234) or alphanumeric (...
-1
votes
0answers
24 views

Bulk re-generate download permissions order

I've importe an old client's store into his new wordpress website with all his clients database. He sells only downloadable products. The problem is that the "download link" of all of the previous ...
0
votes
0answers
14 views

Alter main archive, to show posts with meta as last

I'm having troubles with getting posts with meta_value "sold" as last in the main query of my custom Post type. The best/easiest way i can think of at the moment is to filter the "sold" posts out of ...
0
votes
0answers
19 views

Order posts by term in alphabetical order

I know it's possible to order by terms, but having migrated a huge amount of data from a different CMS, I'm left with a list of brands that are taxonomy terms. I'm using ACF to present the terms as a ...
3
votes
1answer
33 views

Set number of article per number of page

I'm making a timeline using this awesome free theme. As you can see in this theme, it's a timeline separated by "Page". We have "Page 1" with 5 articles, "Page 2" with 5 articles, etc ... I changed ...
3
votes
2answers
104 views

Sort posts by tags in category pages

I would like to sort posts by tags in category and archive pages. (Unfortunately there isn’t an orderby parameter for tags. That would make things so easy!) So a category page would be like this: ...
0
votes
0answers
31 views

Best way to Order Post in Home without a plugin

We are trying to reorder one section of the home page. our approach was with meta_keys and meta_values WP_Query Sample: <ul id="featuredMain" class="feautrued-main"> <!-- Main ...
0
votes
1answer
49 views

WP_Query with multiple orderby NOT working with ASC and DESC, what's wrong?

I have a query with multiple orderby params in a custom page that I am having difficulty getting to work. The query is to return posts with either tag-AAA or tag-BBB tags. And I'd like to sort it ...
0
votes
0answers
31 views

Reorder posts in a custom Meta Box

I have a list of Posts (of a Custom Post Type) that is displayed in a Meta Box for a different CPT. In this Meta Box I need to enable the user to reorder the posts. Currently, the list of posts is ...
0
votes
1answer
16 views

orderby in WP_QUERY - Use the order from the Dashboard

I'm using the Anything Order Plugin to order custom post types in my dashboard. For a wp_query, I'd like the output to order the posts in the same order as I have them in the dashboard. What would ...
0
votes
0answers
46 views

Add post order to function

How to add post order to this function? I would like to display most recent post from newest to oldest: <?php //Establish first post check variable $first_post = true; query_posts('category_name=...
0
votes
1answer
29 views

Show first posts with custom field not empty and order all by title

I have a custom post type called "products". My goal is to make my custom query that I have on homepage and also the search query show first the posts that have a custom field called "id_number" not ...
0
votes
1answer
11 views

Option for pages order in backend

Can someone tell me what is this ordering in pages list in backend and how does it affect anything? Searching for wordpress pages order doesn't give me meaningfull results
0
votes
2answers
52 views

How to quickly reorder posts in the admin panel that will persist for the wp-api

I generally use the Intuitive Custom Post Order plugin for any WordPress sites I work with so clients can order their posts visually. For this project, I'm using WordPress as an admin panel and ...
0
votes
1answer
49 views

Orderby taxonomy term id using get_posts not working

I'm looping through a series of custom post types and then grouping those by a taxonomy term. That is working great, however I have not been able to order these groupings by term_id. I used a ...
1
vote
1answer
35 views

Sort/list/arrange comments by comment author in un-nested/no thread comments

I've looked far and wide and found nothing about this. I'm wondering if it's possible to sort/arrange all the front end comments, in an un-nested comment by comment author?
3
votes
2answers
56 views

get_the_terms in descending alphabetical order

I'm displaying a list of terms that a post is assigned to by using the following: <?php $terms = get_the_terms( $post->ID , 'winetype' ); $sep = ', '; foreach ( $terms as $term ) { echo $...
0
votes
1answer
16 views

Change posts archive ordering

I need to change the order of my default posts archives so I have added this to my functions.php but it doesn't affect anything... I've looked at various examples and from what I can see it should ...
0
votes
0answers
33 views

Show list users based on two custom field values

I'm kinda stuc. I have added an extra field in the user profile for my authors, called ArtistCategory which can be Tattoo or Piercing. I'm using this key and value to filter for menu and gallery ...
0
votes
2answers
39 views

WP Query with multiple post types ordered by custom meta date then published date

Two post types blog and events. I want to list in the same query but order events by their event date and blogs by their published date: $args = array( '...
0
votes
1answer
42 views

Query Posts that have or don't have a meta_value and order by the same ASC

I'm trying to perform a scheduled update to all posts, 10 posts at time. To achieve this, I run Cron job with a script that saves 2 post meta: $DATA: the data I want to be update $TIME: the UNIX ...
0
votes
2answers
47 views

If value present, order posts by two consecutive custom fields

Basically on my site I have a bunch of song lyrics and in a static page I want to show them listed by album Link to my website and album position of the song and I have two custom fields with that ...
0
votes
0answers
21 views

Custom Field - Save Pageviews For Specific Time Period

I have a custom field called page_view to save page views. Now I need another custom field called page_view_last_24_hour to save page views in last 24 hour. Is it possible to use custom field to ...
0
votes
2answers
90 views

How order posts from category by date and comment count?

Just like in topic I try to order posts from category by date and comment_count but code below doesn't work: <?php //get post from current category $category = get_the_category(); $...
0
votes
0answers
15 views

Category page ordered by custom fields with IF conditions

on my site I need to sort posts by a custom field when shown in category pages like this one, but my problem is that I kinda need to do it like this: -if post of the "lyrics" type has the field "...
0
votes
0answers
31 views

How to allow users to select post order in any archive page?

I have build a something like forum using WordPress (Not using plugins). Now I want to display select filed to select user to post order ( Most recent posts, most active posts, most votes post, etc),...
0
votes
0answers
25 views

Archive page: how to orderby category and then by author?

Is it possible to display an archive page ordering its articles by (sub)categories first and by author (alphabetically) as second level order? What do I need to modify and where?
0
votes
1answer
28 views

Custom Post type sort order not working in the admin area

I have a WordPress site that has a couple of custom post types. None of these custom post types allow me to sort the posts alphabetically or by date in the admin area. I have looked all over online ...
1
vote
1answer
59 views

Use pre_get_posts to sort meta_key by an array of values

Scenario: I have a bunch of resellers loaded under a "reseller" post type. Each of these resellers have a "rating" which is a string value like Gold, Bronze, Silver - this indicates their status as a ...
0
votes
0answers
32 views

How Can i order posts in category pages ? They are not in correct date order

Is there anyone who can help about changing category pages order. Somehow they are not in correct date order ? URL : http://abbakimevi.com/category/bizden-haberler tempalte-blog.php : <?php /* ...
0
votes
1answer
59 views

Get query result according to merged array

1st query selecting the records that are found $old_args = array( 'post_type' => 'product', 'meta_query' => array( 'relation' => 'AND', array( 'key' => ...
0
votes
0answers
22 views

ordering alphanumeric terms by numeric value

I have a list of terms under a custom taxonomy which all terms in there have combined alphabetic/numeric names (sheet 38 for example, which actually includes a a space as well). I want to order them ...
0
votes
2answers
32 views

ORDER BY custom field value

Based on example here https://make.wordpress.org/core/2015/03/30/query-improvements-in-wp-4-2-orderby-and-meta_query/ I'd like to modify the query $q = new WP_Query( array( 'meta_query' => array( ...
0
votes
1answer
64 views

ORDER BY custom field value out of where clause

Based on example here https://make.wordpress.org/core/2015/03/30/query-improvements-in-wp-4-2-orderby-and-meta_query/ I'd like to modify the query $q = new WP_Query( array( 'meta_query' => array(...
0
votes
1answer
38 views

Sorting posts by custom fields in meta_query

How to apply 'order_by' in WordPress query in the following example: I have a query to get all posts with custom field for event dates greater or equal current date. I can have up to 10 event dates (...
0
votes
1answer
45 views

How to order custom user list columns by datetime?

I am trying to add the ordering options to some custom user list columns I added in the Wordpress admin. This is my code : function mmm_user_sortable_columns_query( $userquery ){ if( 'test_date' ...
1
vote
1answer
104 views

pre_get_posts order by not working

I am using the pre_get_posts hook to alter a query before it runs. The posts in question are performances and so are date and time based. I want to alter the query to get all performances which are ...
0
votes
1answer
70 views

WooCommerce - Order_itemmeta - Need to add meta_keys to table

I need to add 3 meta values to each order_item to the woocommerce_order_itemmeta table. Any suggestions how to create new meta_keys to be included in the table for all order items?
0
votes
1answer
304 views

WooCommerce - Customer Order History Pagination

I'm trying to implement pagination into WC's customer order history that can be seen on the "My Account" page using woo_pagination(). https://docs.woothemes.com/document/woo_pagination/ The template ...
0
votes
0answers
45 views

woo commerce order success page not redirect

On our Word press site, we have developed a woocomerece payment gateway plugin and it passes the order id and the amount correctly, furthermore if we cancel the payment on the gateway it redirects the ...
0
votes
0answers
80 views

woocommerce display total of completed orders on a product

I want to display the total of only completed orders of a product, now total_sales are displayed, but it contains the total of all orders of a product (processing or completed orders).
8
votes
3answers
351 views

Ignoring initial articles (like 'a', 'an' or 'the') when sorting queries?

I'm currently trying to output a list of music titles and would like to have the sorting ignore (but still display) the initial article of the title. For example if I had a list of bands it will be ...
1
vote
0answers
14 views

comments sorting incorrectly across multiple pages

This is a related_comments.php file which should display comments on certain pages in ascending order while the newest comment should be at the top. This is working fine if there is only one page for ...
0
votes
2answers
91 views

Advanced WP_Query with meta_query, orderby?

I wonder if anyone can help me with this little complex query with ACF. I have the following so far which should display: Pages, News Articles, About Articles and Involved Articles. Show: only ...
0
votes
0answers
17 views

Separate carts in one order

I have to create a commerce site where user can combine items in packs within one order like ie. in cart is 6 items. 4 in one pack and 2 item in second pack. Each pack goes to different address. Any ...
1
vote
0answers
26 views

Order char by post title

This is my code: $args = array( 'post_type' => 'post', 'orderby' => 'post_title', 'order' => 'DESC', 'posts_per_page' => 15, 'tax_query' => array( array( ...