The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
1answer
452 views

Order custom fields alphabetically

I've been trying to order the custom fields alphabetically, but I can't get the ordered list I want... this is the code I'm using: <?php $vMarca = get_field('tienda_marcas' , false, ...
0
votes
1answer
21 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 ...
0
votes
1answer
632 views

WP_Query post at custom position

Lets say I have a custom query which based on two custom post types: $wp_query = new WP_Query(array( 'post_type' => array('post-type-1', 'post-type-2'), 'post_status' => ...
0
votes
3answers
1k views

Ordering Posts with Custom Taxonomy Terms Array

I can't get the order of my posts (organized by custom tax terms) to come out right in my loop. I made a custom post type of 'staff', in staff there is a custom taxonomy of 'staff-title'. I added ...
0
votes
1answer
14 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
27 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 ...
1
vote
1answer
656 views

Sort posts by multiple meta key values

I'm not new to wordpress, but I'm not very good at PHP. I hope someone can help me, since I already tried to search for a solution for over 5 hours with no luck. So I have an archive.php page where I ...
0
votes
0answers
28 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 ...
1
vote
0answers
530 views

Get Woocommerce variations order / sorting

As I can see the order of the variations on a variable product is done via the "menu_order" data of the variation. What is the most efficient way (in terms of backward compatibility and code quality) ...
0
votes
2answers
27 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( ...
1
vote
1answer
847 views

Trying to sort and display categories(not posts) by custom field: 'order'

I'm a WordPress rookie. I've added a custom field to my "Category" taxonomy. The custom field is "custom_order" and its purpose is to hold a number so that my categories can be sorted and displayed in ...
0
votes
1answer
35 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
1answer
1k views

WP_Query orderby random do not repeat infinite scroll - one loop

I have found a lot of documentation on solving this issue with multiple loops, I'm finding it hard to see a solution for one custom loop. Problem: I'm using infinite scroll to load in the next page ...
0
votes
2answers
43 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
18 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
43 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
14 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 ...
1
vote
1answer
42 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
28 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, ...
0
votes
0answers
23 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
21 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 ...
0
votes
1answer
450 views

How to check if a product is purchased within the last 365 days before displaying something

I have a WP site using WooCommerce. Our products are made up of physical stock, a download and some links to pages on our site. I had set this up by placing the links to the specific product pages ...
0
votes
0answers
28 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
55 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
2answers
414 views

Custom loop of a single category, cannot order by date. What am I missing?

I'm going nuts. All I have is a simple loop on the home page of the site (which is a static page), and it should show the most recent (1) post of a certain category. The trouble is no matter what i ...
0
votes
0answers
20 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
27 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
36 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' => ...
0
votes
1answer
32 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
38 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
64 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
34 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
0answers
171 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 ...
4
votes
1answer
5k views

Order get_terms() By Custom Field

I want to order my categories like I order my pages. I've added an extra field called Order to my taxonomy, but how do I order my terms by this value? Adding and Saving my Order Value: /** Add New ...
8
votes
3answers
333 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
6answers
4k views

Order get_terms using a Custom Field

I have a custom taxonomy of "crb_issues" that has a custom field associated with it that is "issue_date" which outputs a date value for each term to looks a lot like "20140601" yearmonthday. I am ...
0
votes
0answers
25 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
43 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).
1
vote
2answers
3k views

How to order separated Custom Post Search results

I am using the technique described here Seperating Custom Post Search Results and here posts_groupby problem to seperate my search results and group them by post type. This means I have the following ...
1
vote
0answers
13 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
56 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
13 views

Error in checkout page but order is booked

On my checkout page I get this error message: "Payment error: Invalid merchant account ID". Despite the error the order is set in orders. How can I prevent a new order when there is an error. ...
0
votes
0answers
8 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
25 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( ...
0
votes
0answers
53 views

Guest order view

Does anyone know how to configure woocommerce the way that "guest" customers could view their orders online. maybe additional plugin? with some verification fields like email & order#.
1
vote
2answers
28 views

Ordering Taxonomies / Changing term_id

I have a site where there are nearly 200 series (custom taxonomy) and roughly 10 items (posts) in each. Each series is called 'Name: Series Number - One liner bout the series'. When I use get_terms ...
1
vote
0answers
14 views

Get the taxonomy of a post hierarchically

I would like to get all the taxonomy of one post (in a loop), hierarchically. Example I have those taxonomies, and the ID of the tax in bracket. Tax1(1) -Tax2(3) --Tax3(2) I would like to gather ...
0
votes
1answer
30 views

Sort by meta key within same day

I try to build something that can sort posts by day - and whithin the same day sort them with any meta value (integer) - like popularity or vote or what have you. So that, in the end, i get today's ...
0
votes
1answer
78 views

WooCommerce: Add Payment Gateway Field to Webhooks [closed]

I have created a custom Payment Gateway for a special EFT system we have setup. The Bank Account and Routing Number are supposed to get encrypted then sent to a Salesforce via the WooCommerce webhooks ...