Sort WordPress custom post types through Front End
This will allow you to create custom sort lists through the Front End of your site.
This is a sample of how the sort interface will appear:
During the last years the WordPress become one of the best Content Management System, the features and a great interface, also the ease of usage makes the best environment for a serious website. There are certain functionality which is not available either planed to be implemented giving the complexity, the Advanced Post Types Order plugin got the content management a step further and fill a gap in the WordPress core by implementing the possibility to sort any custom post types. We all know how important is the data and texts positioning on front site, as this will make the difference of retain a visitor interest or make it go away. Time is an important aspect for everyone, so making the important things show first will be a huge benefit all.
Recently the Advanced Post Types Order got an important update, any sort type is now possible through front end. This is an important feature for those who do not allow users to access the admin interface. The feature is available in a form of WordPress shortcode which can be used within any page, post or any custom post type, like a regular shortocde.
How to apply WooCommerce category order while using visual attributes filtering
Sorting WooCommerce products is an easy job, specific area ordering is possible after selecting the appropriate taxonomy or attribute. When using mix of multiple taxonomies or/and attributes a sort is still easy to create through advanced set-up
Sometimes, there’s no need to apply a very specific order for all those areas, as it become impractical and hard to maintain. Might be a better approach to use a simple sorting which apply to categories, even if there’s additional visual filters used. (more…)
Turn off visibility for WooCommerce Hidden products within sort list
Catalog visibility for WooCommerce is a simple way to keep certain products visible or invisible for customers, hidden products will not show on front side shop. Mainly this is being used for content not yet available or under development. The option is being integrated within Publish widget or through Quick Edit.
(more…)
Using sorting functionality along with DIVI Filterable Portfolio module
DIVI provided by Elegant Themes is just great! Excellent functionality provided through their visual composer and modules, make things easy to manage and stunning layout creation a breeze.
Advanced Post Types order plugin provide total control over the content sorting for your DIVI powered website. Sorts are maintained easily through lists, which can apply globally or to different areas, independently, without conflicting with each other. (more…)
How to retrieve the sticky posts for a sort
The default WordPress Sticky functionality is very limited. It allows to put a post on top of the list which is pretty much everything about it. Beside other missing functionality, there is no control over order, making the list totally uncontrollable.
(more…)
How to sort posts automatically by a Last Name included in title
Automated sorting is always a fast way to maintain ordering without any admin intervention Automatic Order.
(more…)
Sort post objects assigned to a taxonomy terms but not it’s children
Per WordPress Codex when creating a custom query, and request objects which belong to a specific term, direct assigned objects will be included. Also all other objects which belong to child terms related to queried term will be returned too. This is the default behavior observed within WordPress dashboard, when filter for a specific category, all posts assigned to the term and it’s child will be show. (more…)
How to randomize the first 10 posts in a manually sorted list
The first step will be to create a sort which match a specif area of the site. Any sort type can be used either simple sort or mix of taxonomies and post types.
(more…)
Update the sorts when changing the site default language
To allow sorting for different languages through custom plugins like WPML the plugin implemented a custom functionality which also save the sort language. The feature becomes active right after plugin activation, even if there’s no multilingual code active yet to preserve sorts compatibility for later usage.
(more…)
Sample code on how to apply the sort for Post Types Order plugin
The Post Types Order plugin is a great tool for sorting site content. It include the Autosort functionality, if turned on will auto-apply the customized order to all queries, there’s no need to modify any code. This makes it the ideal tool for people who don’t care about programming and just want an out-of-the-box tool.
Sort can also apply only to certain queries, the Autosort need to be turned OFF. The ‘orderby’ => ‘menu_order’ need to be included within custom query arguments.
$args = array( 'post_type' => 'feature', 'orderby' => 'menu_order', 'order' => 'ASC' ); $my_query = new WP_Query($args); while ($my_query->have_posts()) { $my_query->the_post(); (..your code..) }
The sort can be reversed using the ‘order’ => ‘DESC
$args = array( 'post_type' => 'feature', 'orderby' => 'menu_order', 'order' => 'DESC' );
When using Autosort, there is a filter pto/posts_orderby/ignore to ignore specific queries, more details at Ignore sort apply for certain query on Post Types Order
For advanced queries and sorts see the Advanced Post Types Order and it’s Documentation.