Articles of sort

Sortby parameter to sort users

So for my post list, currently these are sortby post_count. Now, I am trying to sort the posts by “most newest” or “recent” Here is how the shortcode works [sortby=post_count] Other parameters can be found from Order & Orderby Parameters, however I could not find parameter for “most newest.” Any suggestions?

wordpress custom loop ascending descending posts by custom field

I am developing wordpress site that is depend upon price so i add custom filed named ‘price’ <?php while ( have_posts() ) : the_post(); echo $price = get_post_meta($post->ID, ‘price’, TRUE); endwhile; ?> it is basic loop to show out price of all post. requirement : can anybody modify above so its shows post according ascending […]

How to order WP_Query to group results?

I have a list of products in WooCommerce that have titles like so: Please note: The “groups” are just for myself, they are not categories etc. All products are the same type of product, just two types of products have different codes (Z and UK) “Group 1” – Unique numbers 5000 4999 4998 4997 4996 […]

Sort and paginate custom post taxonomies alphabetically

I need to sort and paginate custom taxonomy post types. i have a page where i have next and previous link. on clicking next and previous link next or previous brand(custom taxonomy) should load. I have achieved this so far $terms = get_the_terms( get_the_ID(), ‘brand’ ); if($terms) { $BrandId=$terms[0]->term_id; $nextBrandId=$BrandId+1; $prevBranId=$BrandId-1; $next=get_term_by(‘id’, $nextBrandId, ‘brand’ ); […]

Make a custom column sortable by a value from a different custom post type

I’ve created some custom columns to display my custom post types more attractively in the admin section – the columns are mostly custom fields. Mostly, this works absolutely fine, and I can sort by the custom field columns as expected. However, one of the custom fields points to the post ID of a different post […]

Sorting for custom column in WordPress admin post table

I know this question has likely been asked many times, but I’ve tried so many supposed solutions to this issue and so far nothing has seem to have worked. I’m using the Advanced Custom Fields plugin to create a custom dropdown field called statuses to a custom post type st_kb. With the field created I’ve […]

Order by modified date working in POSTS but not PAGES

I found the following code at bytefreaks.net. It adds a sort-able column to edit.php, but the column appears only on Posts and not on Pages (…?post_type=page) bytefreaks suggested putting it in functions.php but I wanted to avoid update problems so I installed the “My Custom Functions” plugin and put the code there. I don’t know […]

Sort search results by Custom Field

I have a custom post type called “data-base” which always need to be sorted by a custom field called “title_stand”. I have managed to apply the proper sorting to the archive-data-base.php file, however I’m having trouble applying that same sorting to the search results page. Could anyone point me in the right direction to sort […]

Sort results without WP_QUERY?

I am new to coding a WP_QUERY and I tried a few things with it but it doesn’t seem to work. Right now (you can see the page here: http://boomerang.mannydesigns.co/artistes/parcourir/musique/ ) I need to reorganize the ordering of these artists by a custom field I added (with ACF) name exclusif which is a selection field […]

How to tag the main tag?

I have code displaying related posts (to the selected post in the single.php file) based on tags. Posts displayed are those with the same tags as the single post, the selected one. I realize that tags are ordered alphabetically (maybe not true?) so I can’t go around and select only based on the first/last entered […]