All Questions
35
questions
0
votes
1
answer
73
views
Elementor - Sort by name
I have a website that lists paintings. All these paintings are made by various artists. I've added a custom post type "paintings" and created a form so each painting can be easily entered. ...
1
vote
1
answer
125
views
query loop "inherit query from template" prevents setting sort order
I need all auto-generated category pages to sort oldest-to-newest
I'm editing my "All Archives" template in block editor but I'm not having any success
it contains a query loop with "...
1
vote
0
answers
419
views
Compare ACF date field (if exists) and post date and order DESC
I have an ACF date field (same format as post date) and in my Query I want it to be compared to the publish date of the post:
If erstelldatum is not empty use erstelldatum for order
If erstelldatum ...
1
vote
1
answer
29
views
Order By Post Type ThenBy Taxonomy
Assuming I have these custom post types:
Product
Video
Article
And for Product (WooCommerce Product), we have many Categories, one of which is called "Parts".
I have this situation where I ...
0
votes
1
answer
287
views
Order posts ascending from posts in array
I have all my post id's in a specific array $productIds. When I want to show only these posts, I do this query:
$args = array(
'post_type' => 'Product',
'orderby' => "...
0
votes
1
answer
835
views
Move some posts to end of sort order, even if there is a sort in the wp_Query already
I have a site that lists properties for sale. I have a custom wp_query, with a sort dropdown I created. This dropdown reorders the posts query by date, price (low-high & high-low) and beds (low-...
0
votes
1
answer
171
views
Custom post type order by post_title
I got a custom post type called "employees" and this is the query I use with FacetWP (plugin we are using). We want to sort the employees by post_title.
<?php
return [
"post_type" => [
"...
0
votes
1
answer
712
views
Orderby event date (if it exists) or post date (if it doesn't) - how to reorder posts based on meta value OR date
I need a way to sort the posts on my tag and category archives according to the event date (if it exists) OR post date (if it doesn't).
I have a combined archive for events and posts, but want to ...
1
vote
0
answers
532
views
WP_query sorting can't sort danish letters (æ, ø, å)
I am having an issue, with making a WP query sort correctly, using danish special letters (æ, ø and å in this case).
I have a loop running a query for certain post types, then returning them ...
1
vote
4
answers
5k
views
sort search results by custom fields using dropdown
On my search.php page, I have a "Sort By" dropdown that almost works exactly how I want it to --
<select class="dropdown-class" name="sort-posts" id="sortbox" onchange="document.location.href=...
0
votes
1
answer
127
views
Ignoring 'a' when sorting posts
I'm attempting to sort my posts on a page while ignoring 'a', 'an' and 'the'. I found a good example on this page: https://css-tricks.com/ignoring-the-in-wordpress-queries/
My Query
$args = array(
...
0
votes
0
answers
39
views
New custom post type entries are not sorted correctly in admin using pre_get_posts
I am working on a WordPress plugin and trying to use the pre_get_posts hook. Everything seems to sort, but when I add new items through the back-end, they get added to the bottom and not sorted for ...
0
votes
1
answer
43
views
sort query results by newest
I wrote a query:
WP_Query(array('post_type'=>'portfolio_item', 'post_status'=>'publish', 'posts_per_page'=>-5));
which works and does what I want except it sorts the results from oldest to newest, ...
2
votes
3
answers
2k
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....
7
votes
4
answers
3k
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 ...