0
votes
2answers
39 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 ...
0
votes
1answer
41 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 ...
0
votes
1answer
100 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 ...
0
votes
1answer
45 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 ...
0
votes
2answers
402 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 ...
0
votes
1answer
32 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 ...
0
votes
0answers
105 views

Order Events by Category or Type, The Events Calendar

So I've using the Events Calendar Plugin which is really working well for what I am trying to accomplish. However, I have run into a snag. I want to organize this query below by displaying an ...
1
vote
1answer
67 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( ...
0
votes
1answer
196 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 ...
3
votes
2answers
800 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 ...
0
votes
1answer
138 views

Can't seem to do combined query AND sort?

Below is the code I'm using to query multi-day events. The problem I'm having is that I can either sort by the start date (evstart_date) OR I can do a combined query against start date and end date ...
0
votes
1answer
228 views

Query posts alphabetically within this function

I've been given some code to tidy up and edit a bit and the client wants to organize a custom post type named "plans" alphabetically. It's not a straight forward query and I've never come across ...
3
votes
2answers
506 views

Sort X categories by last update and show image

I want to display X categories, and sort them by last update. I also want to grab the image of the latest post with the category. <img src="<?php echo ...
3
votes
3answers
585 views

Fulltext search in posts sorted by relevancy

I'm building a custom search page and what I need is to sort results by relevancy (eg. occurences of a keyword) Using MySQL docs I've built this query: SELECT ID FROM $wpdb->posts WHERE MATCH ...
0
votes
1answer
188 views

How to “orderby” the first array in a meta_query that uses multiply keys?

My query is currently sorting by end date. How can I make it so it will sort by the start date? $args = array ('post_type' => 'events', 'meta_query' => array( ...