The tag has no usage guidance.

learn more… | top users | synonyms (1)

3
votes
1answer
27 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
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 ...
0
votes
1answer
2k views

How to let users choose posts order in categories?

I'm running a wordpress based website and I need to let the users choose how to show the posts inside categories pages. I would like to have a button inside a category page that can be clicked so the ...
0
votes
2answers
851 views

Sort All Posts by Category Name in the Admin Panel?

I'm working on a pretty complicated site where everything is managed by category type including automatic spinner image submission, etc.. Unfortunately, its doggone difficult to manage things when the ...
0
votes
2answers
1k views

Make custom post type column sortable

My site has two custom types: Auction and Lot. Lots are connected to an Auction via the post_parent field. I added an Auction column to the Lots list in the admin area. function ...
0
votes
1answer
724 views

initial sort order for a sortable custom column in admin

I have created a number of 'views' column in the admin area of my posts. There are several tutorials for this and I did in fact use a number of these to arrive at my end result. It works as expected ...
-3
votes
0answers
17 views

How to group posts by date?

I want to display posts by date on the homepage. Example: June 21, 2016 Post 1 Post 2 Post 3 Post 4 Post 5 Post 6 more June 20, 2016 Post 1 Post 2 Post 3 Post 4 Post 5 Post 6 more
0
votes
1answer
425 views

Sort orders by custom order meta - Woocommerce Orders admin page

I'm trying to sort my Woocommerce orders by _payment_method on the 'Orders' admin screen (edit.php?post_type=shop_order). So far I am able to sort by 'Pay_by_phone', but it sorts everytime the page ...
0
votes
1answer
34 views

Grouping and paging CPT events by month with custom field date

$start_date = date( 'ym01' ); $end_date = date( 'ymt' ); $meta_query = array( 'key' => 'event_date', 'value' => array( $start_date, $end_date ), 'compare' => 'BETWEEN',...
1
vote
1answer
587 views

Ordering posts by custom taxonomy in admin area

EDIT @kaiser - this question is slightly different to the answer you posted in that I am talking about sorting by clicking the column title rather than adding a dropdown to filter by taxonomy term (...
0
votes
1answer
143 views

Query Set Order By Author

I am attempting to orderby the author_name when you click on the Author arrow on a list of tickets. When you click the arrow, the names are ordering by something I cannot identify. I want them to ...
0
votes
3answers
633 views

Order by a meta field in query loop

I would like to sort my article from a category by a number added in a meta field. Here is the first step, I get the articles to display on the page. <?php $cat = get_post_meta( get_the_ID(), ...
3
votes
2answers
103 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: ...
1
vote
1answer
903 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
788 views

Sort posts by custom fields value using dropdown menu

I'm trying to sort my posts by a custom field value, called price. Only using numbers in the custom field value. I want that the visitors of the website can sort the posts on price by using a dropdown....
2
votes
1answer
53 views

Advanced orderby with multiple meta_query

I am on latest version of WordPress. I have scoured the codex concerning wp_query and meta_query. I also read through these: https://make.wordpress.org/core/2015/03/30/query-improvements-in-wp-4-2-...
2
votes
0answers
32 views

Number of pages - multiple (custom) post types

My archive query contains a custom posts_per_page, order, orderby, post_type and paged (via wp-pageNavi). array ( 'order' => 'DESC', 'orderby' => 'title', 'paged' => 1, '...
0
votes
0answers
56 views

Sorting Grids with Essential Grid and Events Manger

I am using Events Manager to control my Events, but Essential Grids to display previews of these events in various places throughout my site. An example of this is http://staging-dbmax....
1
vote
1answer
33 views

How to show the entries in a custom taxonomy by author?

I have a website that I'm building for people to write their own books. I have a custom taxonomy for this, labeled books. I now need a link or pull-down that contains all of the authors on the site, ...
6
votes
3answers
67 views

Random sort within an already sorted query

I have a working query which returns a set of custom posts which are ordered by their package ID (ASC). For a query with 9 results this may return for example: 4 posts (Post ID's 1,2,3,4) with ...
0
votes
1answer
50 views

Sorting custom post type columns with external data and without meta values

I created a custom post type 'Book', for which data is stored in an external database (like ISBN, author etc). The WordPress database contains the ISBN per custom post, which connects the correct data ...
0
votes
2answers
42 views

WP Query and date format

I've been using a CPT named "session" that has some date fields. Those date fields are stored via the CMB2 plugin with something like this : $cmb->add_field( array( 'name' => __('Begin :', '...
0
votes
1answer
29 views

Merge arrays and order set and subset as one

I have two arrays that filter and order posts by two different custom keys. What I need to do is to merge the arrays and order them by their own custom keys, to not have first a list of the array a ...
0
votes
1answer
958 views

group search results by post type?

My site has 3 unique post types: Default Blog posts ("post") custom type "lesson" custom type "series" When the user searches the site, I would like pertinent results from all 3 post types to show ...
3
votes
1answer
5k views

Custom Table Column Sortable by Taxonomy Query

I am looking to add a custom column to a custom post type post listing table in the dashboard. I have read many questions / answers on WPSE, along with this article. Although, it seems like everyone ...
0
votes
0answers
42 views

Sort search results by meta_key value

I really need help with this. Below is a code of my template for search results page search.php and everything works just fine. Now, the website is about public events so it's very important that ...
0
votes
0answers
47 views

Wordpress admin sort by custom column

Modify default columns function my_page_columns($columns) { $columns = array( 'cb' => '<input type="checkbox" />', 'thumbnail' => 'Thumbnail', 'sort' ...
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
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 ...
3
votes
4answers
12k views

How to get Page/Post Gallery attachment images in order they are set in backend using WP_Query()?

I am trying to retrieve all the images from the Gallery of a page in the order they are set in the backend. So far I have: $my_wp_query = new WP_Query(); $all_wp_pages = $my_wp_query->query( ...
0
votes
1answer
45 views

Advanced Custom Fields: Sorting custom columns with custom fields sorts only by date

I have a custom post type – “members”. With help of Advanced Custom Fields(AFC) I’ve created a Field Group with 5 fields and assigned that group to my “members” post type. I followed this article to ...
0
votes
0answers
29 views

+ 0 in ORDER BY

My $args: Array ( [post_type] => course [showposts] => 99999 [orderby] => meta_value_num [order] => DESC [meta_query] => Array ( ...
0
votes
1answer
46 views

Removing custom sort order from admin page listing

For the background to my question: On my page listing, I've got a set of pages that are countries and the child pages of those are categorised into 'Types'. So I've got a page structure like this: ...
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 ...
10
votes
5answers
7k views

Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title

I'm working on a custom taxonomy term page template where we want the items that are connected to the term sorted by a publication date (custom date field) - and if there are multiple items on the ...
0
votes
1answer
75 views

Sort results without WP_QUERY?

I am new to coding a WP_QUERY and I tried a few things with it but it doesn't seem to work. Right now (you can see the page here: http://boomerang.mannydesigns.co/artistes/parcourir/musique/ ) I need ...
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
0answers
31 views

Complex sorting of custom-post-types

Custom post: people, custom taxonomy: department, each department has (optionally) a custom field (boolean): team leader Desired output; Heading: Department A Team Leader Department A People in ...
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 ...
0
votes
5answers
582 views

Displaying Posts Depending on Number of Comments and Latest Comments?

I would like to be able to display a list of posts on a page depending on when and how many comments they've got. Something similar to how it is here on stackexchange. To be more specific, I want: ...
0
votes
2answers
210 views

Sort and paginate custom post taxonomies alphabetically

I need to sort and paginate custom taxonomy post types. i have a page where i have next and previous link. on clicking next and previous link next or previous brand(custom taxonomy) should load. I ...
1
vote
1answer
103 views

Custom post type 'orderby' => 'meta_value' not working

I have a custom post type called Member I have added code to my functions.php file to add a couple of custom column headings (which is working) for First and Last name and Member Type but I can't get ...
0
votes
0answers
293 views

Woocommerce sort by price with [products] shortcode

I have been looking all over the internet for a solution past few hours, there's this problem that I can't sort products by price (low to high) using this shortcode: [products orderby="price" order="...
0
votes
1answer
48 views

Sort by meta value num, but ignore zero value

I have custom-post-type 'company' and taxonomy 'services' fot this CPT. I have created meta-field 'service_XXXX_price' (where XXXX is service id) for companies and fill this field with number. If this ...
1
vote
1answer
61 views

Sort by meta key on archive page

I am trying to sort an archive page using a meta key value (which happens to be a Unix timestamp). Currently I have the posts listed on the page by their WordPress creation date. I want to use the ...
0
votes
0answers
42 views

After sorting product with default sorting why redirecting on shop page instead of category page

I have website with woo commerce product's. I have 3 category's for product's Online Diet plan , Health Consultation , Corporate Wellness all of each category have more that 20 product's. On category ...
0
votes
0answers
51 views

WooCommerce - order products by default or a-z

I have changed the Breadcrumb Bar in breadcrumb.php and added 2 arrows "> next" and "< prev" to the right top, and now we are able to browse the products. To do this, I get the category of the ...
1
vote
3answers
110 views

Sorting posts according to the term they belong to

I have a taxonomy called portfolio_cat with its categories.So now I need to create a slider with that categories as a title and their post items. How I can do that? What loop do I need to have so that ...
0
votes
0answers
256 views

Sorting is not working in WordPress WP_Query

I have created a page where I am sorting the post according to the views. Here is the query: <?php $temp = $wp_query; $wp_query = null; $wp_query = new WP_Query(); $wp_query->query( '...