Post Order By Category

説明

Reverse the post order for a specific category to be date ascending. This is a lightweight plugin that adds the option to reorder the posts from a specific category by published date (ascending or descending). When creating or editing a category from the Admin Dashboard, the user can choose to sort the posts for that category by oldest (old posts on top of the page) or newest (new posts first). Useful for journals, books or achives, who need to have a chronological sort order for certain category archives.

スクリーンショット

  • Sort posts from a certain category

インストール

  1. Take the easy route and install through the WordPress plugin installer or download the .zip file and upload the unzipped folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

FAQ

Where are the options?

When 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.

評価

2022年5月27日
I’m still learning this craft of blogging and I’m not the most technical person, so this plugin really helped to get my memoirs in the right order. Thankyou.
2021年5月26日
This is a perfect plugin for me. Super simple to achieve what I needed. While I want people who visit my blogs to see the latest posts, I have a category for each trip. Having the ability to list these historical trip in chronological order from the first post is absolutely perfect. Thanks so much for this plugin. Darro
2020年10月13日
I have tried other plugins, this plugin works perfect. Thank you 🙂
2019年10月11日
Awesome plugin. Does exactly what it states it does. Gave me the necessary option to control the post order each time I have to create a new category for my website.
5件のレビューをすべて表示

貢献者と開発者

Post Order By Category はオープンソースソフトウェアです。以下の人々がこのプラグインに貢献しています。

貢献者

“Post Order By Category” をあなたの言語に翻訳しましょう。

開発に興味がありますか ?

コードを閲覧するか、SVN リポジトリをチェックするか、開発ログRSS で購読してみてください。

変更履歴

1.0.5

Improve localization support

1.04

Fix deprecation notice in wp-admin. Add support to Custom Post Type UI plugin and update docs.

1.03

Fix php notices on 404 pages. Add support to custom post types.

1.02

First release in WordPress repo.

1.01

Sanitized input and output.

1.0

  • First publicly available version of the plugin.