Admin custom post ordering
Admin custom post ordering
Admin custom post ordering
Given your detailed description, it seems you’ve taken several steps to address the issue of sorting your archive pages in WordPress. The fact that changing the “order”:”desc” to “asc” in the archives.html file of your theme didn’t yield the desired result suggests a deeper issue. Try this in your functions.php file: function wpb_modify_category_query( $query ) … Read more
Custom post type sorting form breaks with pagination
The documentation for WP_Query indicates that ordering by meta value is limited to one meta key and requires the meta_key parameter (untested): $results = new WP_Query( array( ‘meta_key’ => ‘wpcf_catalogue_number’, ‘orderby’ => array( ‘meta_value_num’ => ‘ASC’, ), ) ); If you want additional sorting, you’ll need to sort the result ($results->posts) using PHP (untested): $sort__formats … Read more
Hello Radheeka Chopda and welcome to our lovely community. I would highly suggest you first read How to ask good questions before making more questions. But since I can assume what you are looking for, let me know if this code below helps you with your problem. CODE: // Change the order of posts on … Read more
To sort by title in ascending order (alphabetical order), you can use orderby => title and order => ASC: $args = array( ‘post_type’ => ‘marketing_en’, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘custom_post_type’, ‘field’ => ‘slug’, ‘terms’ => array(ICL_LANGUAGE_CODE == ‘ar’ ? ‘tool-ar’ : ‘tool’), ), ), ); $loop = … Read more
I don’t know much about elementor, but to keep this as a Purely WordPress answer you need to change your query to sort by post name. The code you provided looks like a pre-query filter so you should try this: add_action( ‘elementor/query/kunst_op_kunstenaar’, function( $query ) { $query->set( ‘order’, ‘ASC’); $query->set( ‘orderby’, ‘title’); } This sets … Read more
Add a custom field for sorting the products in a specific category WOOCOMMERCE
Add a custom field for sorting the products in a specific category WOOCOMMERCE – Second try
Meta query sort order is lexigraphical instead of numeric