The tag has no wiki summary.

learn more… | top users | synonyms (1)

2
votes
2answers
415 views

Search results sorted by post types

I am working on a site with several post types - 4 to be exact - and I am trying to setup the search results page to have a filter/sort the results by post types. For example, when a person searches ...
0
votes
1answer
136 views

Alter post order on taxonomy template

I have a taxonomy template that is returning the correct posts (actually a custom post type) but I want to alter the order in which the posts are displayed. However, nothing I've tried will change the ...
0
votes
0answers
77 views

Reverse pagination issue

I installed the Default Sort Ascend plugin for Wordpress because I needed the opposite of how Wordpress displays its posts. It works awesome except for the pagination. Now the Previous and Next ...
0
votes
0answers
146 views

Sorting by meta_value_num in Admin panel not working when filtered by custom taxonomy

I have a custom post type (and related custom taxonomy). In the custom post type's Admin screen, I have various meta fields shown in columns and some of them sortable. One of the columns is ...
0
votes
0answers
415 views

Woocommerce Sorting does not sort the results after page reload

I have code in index.php that shows the Woocommerce products and also provides the dropdown for sorting. Regardless of the option that I choose from the dropdown, the page reloads and yet, it shows ...
5
votes
2answers
253 views

Can I force a metabox to be in one column?

Suppose I created a custom metabox for the add/edit post page that uses a wide width (not suitable for being in the sidebar), is there a way of keeping it in the middle column only and sortable while ...
1
vote
4answers
5k 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
0answers
83 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 ...
0
votes
0answers
226 views

Wordpress: WP_Query search with meta_query, sort by

I'm trying to use WP_Query to return a custom post type within a range of dates (based on a date the user clicked, and sorted by a separate date field. I can desired list of posts, but sorting is a ...
0
votes
0answers
242 views

Sort Custom Post Type List Table in Admin by Multiple Meta Values

I have a Custom Post Type (CPT) called Sessions. The List Table in the admin for this Custom Post Type (CPT) has the following columns: Session # (post id) Session (post title) Day (CPT meta value) ...
0
votes
0answers
28 views

Sorting Custom Posts by category

I want to sort posts of my custom post type on a page. i.e. any visitor can select a category from drop down to list posts of that category on top. Can any one help to do this task? I tried a lot and ...
0
votes
0answers
57 views

Sort posts by facebook comments count

Hi i am working on "category posts widget" plugin. In that there is an option "sort by comments". But that sorting is done by wordpress comments. I need sorting by facebook comments count. i have ...
2
votes
2answers
567 views

Sorting: custom query with orderby meta_value_num THEN by title

i try to run a custom post type query to match following criteria: sort movies first by year in descending order, after that ("inside" the year order) by title alphabetically. desired output: ...
1
vote
1answer
145 views

Sort by page information by Ascending Numbers

Basically I have a problem that I have details being pulled from advanced custom fields and I currently have them ordered by page title in ascending order. However, instead of ordering them Ascending ...
0
votes
1answer
124 views

How to filter posts by category INSIDE the loop

I'm trying to sort my posts like so: CATEGORY 1 - post title - post title CATEGORY 2 - post title - post title I have no problem achieving this with a custom query: <?php $args = array( ...
0
votes
1answer
256 views

Reorder plugin items in the admin menu

Is it possible to reorder plugin menu items and custom admin items in the Admin menu without modifying the position in the plugin itself? I've tried using the method described here "Changing the Menu ...
0
votes
1answer
154 views

Exclude posts with specific meta_value while sorting by a separate meta_value

I am trying to exclude posts with a specific meta_value with a specific meta_key while also sorting the posts by a meta_value with a different meta_key. This is my current code for the WP_Query ...
0
votes
1answer
133 views

How To Show Get Adjacent Posts If Posts Are Sorted By Custom Field

I want to get the ID of adjacent posts. For posts sorted chronologically you can use: get_adjacent_post Are there any standard methods for finding the adjacent post if the posts are sorted by ...
1
vote
2answers
570 views

Archive listing of posts by publish year (multiple years)

I have an archive page showing all blog posts (in a specific category). With a growing number of posts, I want to separate these by publish year. For example (simplified), I'd like the following: ...
0
votes
1answer
127 views

Adding Sorting to Website?

I would like to add sorting but don't have any idea how ot go about it. I would like to be able to sort by: Date, Title, Price (custom field), Comments, Views, ASC + DESC What would be the ...
0
votes
0answers
57 views

Sort by user meta data

I am using the plugin: ep-display-user and can't get it to sort by meta. This is my code: function epdu_get_users($visible){ $user_ids = $this->wpdb->get_col("SELECT ID FROM $this->table ...
0
votes
1answer
167 views

How to get alphabetic listing x other posts, based on first letter post?

Let's say I have a post called "Hello World" and I am on that page... Let's say I have different posts like "Haaaa" and "Hoooo".... What I want to do is showing Haaa and Hooo in a different place (let ...
0
votes
0answers
84 views

Filter by Author on Category Pages

I'm looking for a solution to filter/sort posts by author on category pages/archive pages, ideally by means of a drop-down menu. I've searched the Wordpress plugin repository but cannot find any ...
0
votes
1answer
37 views

List CPT by menu_order with children right after parent

I registered a custom post type drawer where my posts are ordered using menu_order. Each drawer could be a child of another drawer, on a multiple depth (parent > child > child of child > child of ...
1
vote
2answers
1k views

wp e-commerce group product by category

Sorry for my bad english. I have WP 3.3.1 & wp-e-commerce.3.8.7.6.2. On the products page (which use wpsc-products_page.php template) I have list of products. I want to group this products by ...
0
votes
1answer
123 views

Gallery shortcode numerical sorting

When I try to sort a Gallery created through the [gallery] shortcode by numerical titles I get them sorted in alphabetical order. That means that they are sorted like so: 1, 3, 34, 4, 56, 6, etc. ...
1
vote
2answers
894 views

Wordpress Menu Disappears when $query->query_vars['meta_key'] is set

I've set some meta variables on my WP posts. I want to be able to sort by these variables, and everything is working great except when I sort by either "views" or "likes". When I sort by either of ...
1
vote
1answer
215 views

How to display posts via custom taxonomy terms using checkboxes?

I would like to have a form with checkboxes. Each checkbox would be a term of my taxonomy "cities". The idea is that if a user select any of the checkboxes, it should show all posts that are NOT in ...
0
votes
1answer
138 views

How to avoid duplicating same meta_value?

I have "publication_year" as meta_key for some images/attachments. I want to list all meta_values inside html table, but I don't want same publication_year value to repeat, my code is: <?php $args ...
0
votes
0answers
132 views

wp_query orderby value not from meta_value

I'm using the myreviewplugin to add ratings to posts. I'm now working on the posts loop and customising the query using wp_query. Everything is working fine, but I need to expand the orderby ...
0
votes
1answer
58 views

Sorting custom post type by usermeta

I have a profile (a CPT) directory set up and I'm trying to find a way to sort the results based on the last login time of the post author. The goal is to reward recently logged in authors by pushing ...
1
vote
2answers
99 views

Categories sorting

I'm using code below to spit out custom post types along with its categories, so Category 1 ---post 1 ---post 2 Category 2 ---post 1 ---post 2 ---post 3 etc. That works well for ...
0
votes
2answers
675 views

Add multiple orderby with pre get posts

I am already using a small code to set default sort orderby a custom field called "Year" I need to add another orderby to also sort by "Post Title" in the same sort. Sort = Year-Customfield (DESC) ...
0
votes
1answer
49 views

sort custom post type by display name

I am trying to sort my custom post type in a few different ways using a dropdown. When I try to sort it as the display_name it doesn't work. $wp_query = new WP_Query(array('orderby' => ...
1
vote
1answer
309 views

register_post_type sort order by title by default

If I add a custom post type (example code below), in the admin page for the new custom post type the posts are sorted by ID by default. Is there a way to set the default sort order to the post title ...
0
votes
1answer
60 views

I would like my page editor to be sorted by date created, or updated, instead of in Alpha order, is this possible?

When looking at my "All Pages" they are listed in Alpha order, and I have to scroll through to find what I am updating. Is there a way to have a preference setting that it be sorted by date, without ...
1
vote
2answers
2k views

Sort results by name & asc order on Archive.php

I currently use the following code to list posts in Archive.php but I want the results to be ordered by name in ascending order, I have checked the codex but the answer isn't clear to me, how can I ...
2
votes
1answer
275 views

Using database meta_values to calculate new post order using pre_get_posts or a 'request' hook

UPDATE: I have worked out my implementation of the selected answer at the bottom of this post. I'm implementing a sorting algorithm based on Reddit's hotness algorithm, in addition to a time-decay ...
1
vote
2answers
653 views

Wp_query: sort by PHP variable

Here is my problem: For my articles, I use a custom post type "exhibitions" and posts for all other news. I am displaying them in one query ['post_type' = array('exhibitions','posts')]. The orderby ...
0
votes
1answer
136 views

Sort categories by meta value

How can I make a list of categories with 4 last posts in each where every category is sorted by meta_value. For example, template without sorting by meta_value is http://pastebin.com/AeH6vx9b It ...
0
votes
1answer
435 views

Ordering of gallery images without using shortcode in theme

I using the built-in gallery in wordpress to store and sort images inside a custom post type. In the theme I was using: $attachments = get_posts( array('post_type' => ...
0
votes
1answer
139 views

Sort by category and then date?

I'll try to be as clear as possible. My Wordpress site has multiple custom categories and posts types all which need to be displayed on the home page blogroll. But I need the first post on the ...
0
votes
1answer
100 views

Multidimensional array sort?

If i have a set of years, retrieved by the loop, for every years can be more post ID. Like: 2008 => 3,7,8 2009 => 4,5,6 2010 => 9 the code is: ...
1
vote
1answer
1k views

Sort query_posts for Parent Pages to menue order or the count?

thanks to a member here i display my Parent Pages in a 2 column grid with title and excerpt. But for some reason i can't figure out how to sort all 5 Pages by the menu order for example or the order ...
1
vote
1answer
672 views

query_posts and custom taxonomy posts order

i have a custom taxonomy defined for "Projects" and a page that shows all the projects. In this page there's a jquery filtering menu (isotope). Initially the page must show all the projects but ...
1
vote
1answer
63 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
112 views

Autosort uploads in galleries by filename

A client of mine wishes to not have to sort images uploaded into a post gallery, but instead rely on its filename for sorting (e.g. "01_sample.jpg", "02_sample.jpg"). This would save a lot of time for ...
2
votes
3answers
1k views

Sorting results from JSON-API on custom fields

Is there any way, out of the box, to sort results from the JSON-API plugin based on values in custom fields? The request is paged, so the results will need to be sorted server-side. I have an http ...
0
votes
1answer
249 views

WP_Query posts by distance based on LAT & LNG in Database

I've got table in the WordPress database that has lat & lng stored and I'd like to add a sort feature on the results page 'Sort by Distance' that gets the locations that are closer to your ...
3
votes
1answer
802 views

Auto sort the wp-admin post list by a meta key

I am using this following code in my functions file to hide and add some custom columns to my post-edit screen in wp-admin. I am now trying to get the post list to sort by a post meta field (last ...