The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
27 views

next and previous post link ordered alphabetically

I found a snippet, which order all posts alphabetically. I wonder if is there a way to make it working just for one post-type? I have some custom post type in my website, and i want one of them to be ...
0
votes
0answers
10 views

problem in the loop with wp-PostViews

I'm trying to loop using the wp-PostViews plugin, my intention is that it lists the first that has larger view. The problem that is happening is that it is not listing all the posts, just those that ...
0
votes
0answers
9 views

Show custom field value in Edit order / Print invoice page

I've got the following in my functions file: if ( isset( $_POST['university'] ) ) { update_user_meta( $customer_id, 'university', sanitize_text_field( $_POST['university'] ) ); } This in my ...
0
votes
0answers
35 views

order posts with conditions & meta_key merge

i want a code to orders my blog posts using a "conditions" & combinaisons of 2 meta_key so details: if ( postviews < 20 views in exmple) ==> those posts order with date ==> here ...
1
vote
2answers
54 views

Order by menu structure

As I'm making one page website. Here is question I asked earlier: Calling Specific Pages with wp query Part II As I'm calling all pages by WP_Query which is "order by = ASC" I want to call it "order ...
4
votes
1answer
65 views

Select all in parent category, group by child category?

I am trying to format a custom post type for a "series". Each post is an Episode, each Episode belongs to a Season, and each Season belongs to a series (just like a TV show). I have the following: ...
2
votes
1answer
86 views

WP_Query sort by comment meta data

Is it possible to use the WP_Query class to order by comments meta data fields?
0
votes
2answers
24 views

Get posts ordered by meta data

I have a post type gtre and metadata price. The 'price' metadata I get using get_post_meta($post->ID, 'key', true)["price"]; So I don´t know how exactly should I write the args for WP_Query ...
0
votes
0answers
35 views

Change order custom taxonomy

I've created a custom taxonomy BH Job Regions . Now I would like to change the order of the terms in my taxonomy list. Is there a plugin or so that I can do this in my backend? Drag the terms in ...
0
votes
1answer
19 views

Post ordering not working with custom field

I am trying to create an Events CPT with a widget, and can't seem to fathom out how to get the ordering done right. My arguments that I have are: $event_args = array( 'post_type' => 'event', ...
0
votes
1answer
31 views

Filtering by multiple conditions in the loop

I'm trying to filter the posts in my index by multiple conditions. So far I've tried with this: <?php $query = new WP_Query( array( "post__not_in" =>get_option("sticky_posts"), ...
0
votes
1answer
34 views

Alphabetical order in taxonomy.php

I created custom post types and a taxonomy-adhesion.php file (by copying the contents of the archive.php file). I wish the search result would appear in alphabetical order (or by title), but it does ...
0
votes
1answer
45 views

User list order by user meta

i have created user vote that can vote users or author of posts. so for example have 4 users which looks: user --- ID=1 --- META KEY='_thumbs_rating_up' --- META VALUE='13' user --- ID=2 --- META ...
1
vote
1answer
45 views

Complex WP_Query order request: DESC by day, but then ASC by time

I've got a site with a couple thousand time-stamped posts in a custom post type. These get displayed by a few taxonomies and a date query in various views (I've got that all working just fine ...
0
votes
1answer
23 views

Using orderby with 2 meta keys

I can use orderby with one meta key in the WP_Query using following: 'orderby' => 'meta_value_num', 'meta_key' => 'my_key_1', However is it possible to use orderby based on the calculation ...
0
votes
1answer
28 views

WP_User_Query orderby meta_val_num

I know that normal WP_Query's can have an "orderby" parameter of "meta_value_num", but when I try to user "orderby" => "meta_value_num" on a WP_User_Query, it doesn't seem to work. Anyway I can ...
0
votes
1answer
22 views

Creating a post that contains a list of other posts like a table of contents

Is it possible for a post to contain a list of other posts, with a custom ordering like a table of contents? Similiar to the above but is it possible to create a category with a custom ordering of ...
1
vote
1answer
71 views

How to order a post type with meta_value_num and if meta_value_num does not exist then order by date

I want to order a list of post on basis of ratings. I have used meta key "wp_ratings" for storing the rating value in wp_postmeta table. Now I want to sort all posts . If a post does not contains the ...
0
votes
1answer
74 views

WP_Query custom order and pagination

I am seeing some strange behaviour when combining a custom order with pagination when using WP_Query. The arguments for my query are as follows: $args = array( 'post_type' => 'news', ...
0
votes
1answer
29 views

Want to order by Meta Values (tweaking Post Order Widget)

I'm not much of a coder, but I can tweak PHP a bit. Basically I want to order by a custom meta value which integer called "price". The plugin orders by title, so thats what I'm changing to price, ...
0
votes
1answer
47 views

Order posts by custom column using pre_get_posts

Is it possible to sort posts by custom column in wp_posts table (in this case, 'fav_count' column) using pre_get_posts filter? If not, is there any other way to do this before the main query is run, ...
0
votes
0answers
42 views

Sorting “menu_order” does not work in WP Query with multiple post types

When i use my WP Query as follows: $post_types = array('research'); $args = array( 'posts_per_page' => 10, 'orderby' => 'menu_order', 'order' => 'asc', ...
0
votes
1answer
51 views

Display Custom Taxonomy Terns ordered by meta_value

I got stuck with ordering custom taxonomy. I've created a hierarchical custom taxonomy called Brand and created some meta tags including one called position. Now I would like to display my terms ...
0
votes
1answer
108 views

Sorting terms individually for each post

I have a custom taxonomy named author containing multiple terms. The default output order in the front end is alphabetically. But I like the authors to be ordered individually per post, e.g. First ...
1
vote
2answers
97 views

Custom post type archive with rand and meta_value

I have a custom post type that have a meta_key custom_meta_sponsored that owns alphabetical values. "X" means post doesn't sponsored. I want to show the archive page in custom order, sponsored first ...
-3
votes
2answers
136 views

Post list category plugin alphabetical order [closed]

Is there a way we can set these to list the posts in the category by alphabetical order?
0
votes
1answer
58 views

paginate_links() Change the order of links

While using paginate_links() function of WordPress, i need to change the order in which it echo's its output. For example, by default it will output pagination links in this format: Default Output: ...
0
votes
0answers
52 views

Order posts by ACF checkbox

I would like to order the posts (archive.php) by listing the ones with the ACF checkbox "Premium" first, could someone please offer some advice?:) This is what I've tried so far: <?php echo ...
0
votes
1answer
24 views

Add filter to Orderby Parameter using Array

Using WP-Query, I'm setting the Orderby parameter using an array: $events_args = array( 'post_status' => 'publish', 'post_type' => 'events', 'meta_key' => 'start_time', ...
0
votes
0answers
29 views

Dynamic change order value

I have custom post type "Movies" and I have added order attribute to it. add_action('init', 'my_custom_init'); function my_custom_init() { add_post_type_support( 'Movies', 'page-attributes' ); } ...
2
votes
3answers
151 views

How to order posts (woocommerce products) alphabetically but ignore certain words, eg 'The' and 'An'

I need to order my Wordpress posts (that happen to be Woocommerce products) alphabetically, but I want to ignore certain words, eg. 'The' and 'A' and 'An'. Is there a function or filter that can be ...
0
votes
1answer
68 views

shortcode order for event custom post type

ok im working on a website using post type event with post_meta event_start_date, i created a shortcode and everything is displaying fine except for it displaying in order, it seems as its not ...
0
votes
2answers
54 views

Order posts ascending with number in title

I have a page where I show the teams of a football club. I order these with 'order' => 'ASC'. But the problem is that the teams order like I want it to. It orders like this: Team E1, Team E10, Team ...
4
votes
1answer
89 views

How to get order of posts?

How can I get the order through which the query is done? For example, my woocommerce product archive page is querying by ordering according to the order_by select box (as seen below). How can I get ...
2
votes
1answer
78 views

Order tags, but not alphabetically

I'm trying to figure out how to arrange tags on a post using a method other than alphabetically. For example, a post has the following tags; alpha, beta, charlie. The post will always organize tags in ...
0
votes
1answer
88 views

Sorting posts by custom date fields (non standard date format)

I've inherited a website with a post type courses that has a custom field 'date-start', a Date Picker. Unfortunately the date start is stored as 'ddmmyy' and the ACF documentation implies that this ...
0
votes
1answer
22 views

Re-order posts in query after

For a particular category I needed to merge in another custom post type. Now I would like to resort the query based on a custom field. Is this possible? Below is the way I've merged the queries. if ...
0
votes
1answer
106 views

Order posts by tags count?

I am trying to order posts by tag count. I want to order posts with no tags first and posts with highest count last. I tried and got posts with no tags only. $tags = get_tags(); $tag_ids = ...
0
votes
0answers
26 views

custom post type taxonomies order desc

this code works fine here http://wellspringchurchnc.org/redesign/sermons/ but i can't seem to change the order to display in descendent $args = array( // 'posts_per_page' => 1, //'order' ...
0
votes
2answers
58 views

Querying with WP query using meta key price

Could somebody tell me what's wrong with my WP query please? I'm trying to order my posts by price and price is an ACF (a textbox which has a number in it) $args = array ( ...
0
votes
0answers
29 views

WordPress search results order

Is there any way to change the search results order? For example, I would like to order as following: Pages, Category 3, Category 2, the rest. I have no idea where to start from, but I suppose that ...
3
votes
2answers
261 views

Ordering posts having multiple post-meta date fields

Hello WordPress developers. Over the years, I've found answers to many questions I've had with WordPress. I want to thank you for your help. Today, I have a question myself, and seek for expert ...
0
votes
0answers
29 views

Order main loop by category and then post_date

I'm creating an "announcement" post category. I'd like those posts (using the category id) to appear first in the main loop sorted by post_date desc and then the rest of the posts sorted by post_date ...
0
votes
0answers
20 views

Sort get_term_children when they are inside an array

At the moment I have this code below, but it doesn't sort the children. There are some answers on this website, but they involve a known category ID, while in this case the child categories are in an ...
1
vote
1answer
249 views

multiple orderby in pre_get_posts action

I used to be able to sort query results by 2 criteria ("sort results first by status=unsold ASC then by date DESC) like this: add_action( 'pre_get_posts', 'my_get_posts' ); function my_get_posts( ...
1
vote
2answers
110 views

List posts in alphabetical order

What I'm trying to achieve is to set the list shown in alphabetical order. Any thoughts on how i can successfully achieve this? I have pasted the snippet below for reference. <ul ...
1
vote
1answer
302 views

Sort Order for a Custom Query in a Post Type Archive Not Working

I have a custom post type for events set up and am displaying the posts in a custom post type archive "archive-events.php". I am using Advanced Custom Fields to put an event date "event_date" on ...
0
votes
0answers
102 views

Custom Admin Menu Order

I have a simple solution in my functions.php for reordering the admin menu. Here it is: // Admin menu - reorder function custom_menu_order($menu_ord){ if (!$menu_ord) return true; return array( ...
-1
votes
1answer
68 views

Can't sort custom column on user.php by number / meta_value_num?

Everything else works fine but it's still not sorting by number. Would just like to know what I'm doing wrong here Here's the code function add_user_columns( $defaults ) { ...
1
vote
1answer
48 views

Order posts by condition

I need to get 15 posts. If there are any with a tag featured, I want them to be first. If there are none, I want the rest to be random posts. My idea was to sort posts based on a condition ...