Skip to main content

All Questions

Tagged with
0 votes
1 answer
1k views

Ascending & descending posts on same page with IF statement

I need to be able to display a list of events on 1 page. The top list would be for upcoming events and to be sorted with earliest event first and the second list would be for expired/past events and ...
ogmios's user avatar
  • 23
0 votes
1 answer
76 views

Sort / Filter Queries

I'm working on a website, that showcases products, and now I'm working on the query part. Basically I want to have one page, that displays a list of products as a normal query, and then on top of the ...
Forte259's user avatar
0 votes
2 answers
231 views

Sort Wordpress Posts Meta value by Week not Day

Right now I have a metakey called 'epicredvote', it sorts my posts by this epicredvote number. It is doing it on a daily basis at the moment, so if I have 2 posts the post with the highest epicredvote ...
mr. x's user avatar
  • 53
2 votes
1 answer
3k 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 ...
ILikeTurtles's user avatar
2 votes
0 answers
78 views

Sorting posts alphabetical that have single digits

I have post titles that are like this: Episode 1 Episode 2 Episode 6 Episode 10 Episode 14 I try to list posts alphabetically but it ends up showing like this: Episode 1 Episode 10 Episode 14 ...
Ruriko's user avatar
  • 543
0 votes
3 answers
640 views

Re-sort get_posts query results

I have a query that pulls fields from the 3 most recent posts for a carousel: get_posts('posts_per_page=3') I need to re-order the results so that instead of it being 1, 2, 3 it is 3, 1, 2....
hml's user avatar
  • 1
1 vote
2 answers
1k views

How to orderby meta_value_num with dollar ($) sign

The custom fields all have prices including $ signs, and a dot as separator. $theQuery = new WP_Query(array( 'orderby' => 'meta_value_num', 'meta_key' => 'price', 'order' => ASC )); All ...
coder's user avatar
  • 45
1 vote
1 answer
6k views

Sorting posts according to view counts not working

I use the code snippet below to get views count of each post on my sidebar.php . everything works but the sorting does not. also it does not get 4 posts, it only shows 1 post although I've written '...
Payam Shakibafar's user avatar
0 votes
1 answer
1k views

How to manage a particular "order by" for get_search_query()?

How to manage in the search.php file the order of a posts search query managed with the following code <?php echo sprintf(__('%s Zoekresultaten voor ', 'website'), $wp_query->found_posts); echo ...
axel's user avatar
  • 161
0 votes
1 answer
497 views

Sort loop with query in the link

I want to add some buttons that will sort the post by name asc/desc etc. I want to use query in the link like this http://domain.tld/?orderby=name&order=asc Is this safe to use? Are there ...
CK13's user avatar
  • 45
5 votes
4 answers
29k views

Sort posts by category name and title

Trying to figure out how I can output my posts based on category title (a–z) and secondly, the title of the posts within the category: A CATEGORY – A post beginning with a – Because I want to be ...
INT's user avatar
  • 1,281
0 votes
1 answer
68 views

How to rearrange a pool of posts joined using two queries?

I need to select posts for two different months (current, past). As far as i know, it is not possible to pass m date parameter as an array of integer instead of an integer, so I am performing two ...
versvs's user avatar
  • 221
1 vote
1 answer
101 views

Wordpress Custom post query sorting does not work

I created a custom WP query to collect products that have 3 different taxonomy values in them and sorted them by price using the following: $my_products = new WP_Query( array( ...
Amit Wadhwa's user avatar
0 votes
1 answer
322 views

How do I sort multiples pages?

I want to use a dropdown to sort a list of posts in WordPress. The results will display on multiple pages. So how do I pass the query on to the second, third, fourth, etc. pages? Here's an example of ...
user23898's user avatar
6 votes
2 answers
3k views

Sort custom post type list table by display name of a user id stored as post meta value

I have a custom post type named domicile. Each post (domicile) has an owner (not the author). Owners are users with a custom role. I store the user id as a post meta value (dmb_owner) for the domicile ...
fuxia's user avatar
  • 107k

15 30 50 per page