开发者 | nravota12 |
---|---|
更新时间 | 2024年4月9日 04:24 |
PHP版本: | 5.2.4 及以上 |
WordPress版本: | 6.5 |
版权: | GPLv2 |
/wp-content/plugins/
directoryWhen editing or updating a category from the WordPress dashboard (click on posts => categories => edit), a dropdown to select options will appear after the category description. The options are "Oldest" (show posts by date ascending or the so called chronological order) or "Newest" (show posts by date ascending or the WordPress way). The default value is "Newest", which is the same as the WordPress default post sort. When you choose "Oldest", the plugin will automatically display the posts from that category archive page in chronological order. = Are there more options to sort the posts? The plugin currently does not have any more options. However, it can be forked to sort posts by other criteria, including post title. It can also be adjusted to sort posts by more than one criteria. For more information on how to do it, feel free to check this article or contact me directly! The plugin does exactly what it states it does. If you like it, please give it a 5-star rating. = Is there support for custom post types? Yes, since version 1.03, you can reverse post order for category archive pages that belong to custom post types, e.g. projects or portfolio, as long as the custom post type supports post categories. This plugin works with Custom Post Type UI plugin. However, WordPress does not support category archives by default. To display category archive page for category "awesome-projects" for custom post type "project", you need to add the following code in your child theme's functions.php: function my_custom_query_post_type($query) { if ( is_category() && ( ! isset( $query->query_vars['suppress_filters'] ) || false == $query->query_vars['suppress_filters'] ) ) { //replace project and movie with your custom post type name $query->set( 'post_type', array( 'post', 'project', 'movie' ) ); return $query; } } If you are using the CPT UI plugin to create custom post types, you would also need to go to Edit post types>Taxonomies and put a tick on "Categories". Check this article if you need more information how to set up categories on custom post types.