How do I change the default PHP sort order to alphabetic in a WP Loop?

I have a page that is creating a WP Loop that creates a list of pages, and I'd like to change the default sort to be alphabetical. This is the WordPress loop. <?php $i = 1; ...

sort order if empty then products are not displayed

I have created custom post types and custom taxonomy. In the taxonomy i have a field for sort order. if sort order is left empty then the products category is not displayed. Code related to sort...

Custom WP Query for woocommerce product

Getting parameters is query string and using them in wp query and also used tax and meta query for filters need to create sort by: popular, Date and Price using wp query i am getting everything in...

Temporarily Sort WP8 Listbox

I have an WP C# app built on the Local Database Sample (http://code.msdn.microsoft.com/wpapps/Local-Database-Sample-57b1614c). The main page displays a list of items from the xml database, which...

How can this array be be sorted?

I have an array with values as follows: 0-10 10-50 50-100 100-150 150-200 200+ This is actually an array of WordPress taxonomies, which WP sorts alphabetically (or ascending order of the first...

WP job manager change search results order

at the minute the search results are sorted by alphabetic order. I need them to be sorted by closest to the search locations. I'm using WP job manager and the search is provided by google map api...

Paginate, search & sort WordPress $wpdb query for external table

I have a custom table (ERA_Data) in my WP database, which I'd like to add pagination, column sort & search to. Currently the following code successfully grabs the data (over 4000 entries) &...

How to sort terms of custom taxonomies created programmatic via Wordpress back-end?

I have a problem with sorting terms of custom taxonomy. I need some way to sort them manually (not alphabetical or by date) via WP back-end. In future I need to show them in that order. Would be...

Sort an array by a meta_key

Looking to sort an array in an ascending order based on a numerical meta_key. This is based on a function for the Facet WP plugin: https://facetwp.com/preserving-sticky-posts-in-templates/ As you...

WP FullCalendar using custom fields

Basically i'm using a theme that has an events custom post already built and using WP FullCalendar, but it has a load of custom fields for the start date and end date called...

Natural sort Wordpress post titles (alphabetically and numerically)?

Is there any possible way to sort a new Wordpress post query by the title, but numerically instead of alphabetically? I have some titles that have a lot of the same name alphabetically, then have...

Sort WooCommerce cross-sells by date

Woocommerce cross-sells are displayed on cart page. By default they are sorted randomly. Can anyone please help me to sort them by date (= publishing date of product)? Thanks very much! Here is...

How to extend sorting order of Team Members

I'm using Business Lounge theme by RT themes with Elementor. Wordpress version is current (5.2.1) On the team page (Demo: https://businesslounge-demo.rtthemes.com/our-team/) there is a list of...

NGINX order GET parameters alphabetically

We have a production site which runs Nginx and WordPress. I pass this request to the wp-admin/load_styles.php-file: wp-admin/load-styles.php ?c=0 &dir=ltr ...

Wuxt (Nuxt/Vue) sort items in v-for based on parent/child

I want to sort the items in v-for loop which gets comments from a WP db, but the db stores comments with sequential IDs, and since there are replies to some of the Comments their order is messed...

Show category by latest post date

I am working in a project.Where i am using below code to limit number of posts in each categories.But, i can't figure out, to Order (sort)these categories by latest posts. However, my code is...

Display other WP site blog posts in one WP blog

Been scouring the Internet for ideas on how to do this. Here's what I'd like to do: WP Site "A" to be used as a portal of sorts to other WP sites I run, and it will also have it's own blog...

Custom metadata in order list column - woocomerce

I'm running Woocomerce store with ultimate member plugin. It is used to generate custom user meta (let's call it ID Buyer, stored in wp-usermeta meta-key Id_buyer). 99% of orders are made by...

How to sort or rearrange the items in Gutenberg WordPress

Is it possible to sort the Gutenberg Blocks by Alphabetical order ? Please check the screenshot for reference. I would like to sort Alphabetical like Heading, Image, List, Paragraph … Answer: I...

Changing Wordpress post order with URL string

I am trying to add a dropdown to sort my custom posts. I have tried the solutions here - http://ak.net84.net/php/filter-dropdown-for-wordpress/ - and here -...

Display sortable Company column on the wp-admin All Users page

I need to display a sortable "Company" column on the wp-admin "All Users" page. I am using WooCommerce. I modified the code below and was able to add the "Company" column and make it sortable. I...

Why are comment ids in Wordpress continuous (unique)?

I notice that in WP blogs the comments order by continuous id (id=203, id=204 and so..). while I understand the class names "parent" "child" - to sort the reply to thread, I didn't figure out why...

WP_Query - filter by multiple meta values and order by other meta values

I'm trying to query posts using WP_Query and meta_query parameters: $args = array( 'post_type' => 'produkty', 'meta_query' => array( ...

How to sort a 'query_posts' function by custom field, while limiting posts by another custom field

I'm querying a series of posts in WP with the following function: <?php $thirtydays = date('Y/m/d', strtotime('+30 days')); $paged = (get_query_var('paged')) ?...

Wordpress - How can I sort admin area by column in the table

I created a manually post type in Wordpress called mypost. I write a php file for that post<br> I have special table in my database for mypost, there I save all mypost details.<br> I have a column...

Wordpress Query by Meta key, type date numeric

Ii have problem with WP Query, can't order by meta key I use Event Manager plugin, and need query 4 post on my Homepage, I need post only current and future events(posts) and sort by start...

How to sort orders based on orders meta value in Woocommerce / Wordpress

I have a Wordpress website and Woocommerce installed in it, Im displaying orders in admin along with the some extra values which im collecting from ordering page and storing them in other table...

MSSQL CASE after ORDER BY not working with alias

Hello Stack Overflow Community! I'm sitting here with my colleague and we're trying to solve a problem we currently have with MSSQL 2014. We have a table with a number of columns, where two of...

Set Price and Min Order quantity in WooCommerce

I have just very nearly completed a custom theme for a client of mine. However he wants to set the price of 0.50eur and a minimum order price for these products here The problem I have is that all...

Wordpress - Force most recent posts first

I want to use the plugin WP Smart Sort to sort my posts alphabetically, except I need the most recent posted first on the home page. The relevant existing code for the home page is below. Is there...