plugin-icon

List category posts

List Category Posts allows you to list posts by category and many other parameters in a post, page or widget. You use the [catlist] shortcode to selec …
評価機能
4.7
最終更新日時
March 21, 2024
バージョン
0.89.8
有効インストール数
100K
List category posts

List Category Posts では、ショートコード [catlist] を使用して、投稿または固定ページをカテゴリ別に一覧表示できます。 ページまたは投稿の編集中に、テキストにショートコードを直接挿入すると、そこに投稿がリストされます。 基本の使い方は次のようになります。

[catlist id=1] [catlist name="news"]

ショートコードは、カテゴリ名または ID、投稿を表示する順序、および表示する投稿の数を設定できます。 投稿者、日付、抜粋、カスタム フィールドの値、さらにはコンテンツも表示できます。 何をどのように表示するかをカスタマイズするために、多くのパラメータが追加されました。 使用方法については、完全なドキュメントを確認してください。

The [catlist] shortcode can be used as many times as needed with different arguments on each post/page. [catlist id=1 numberposts=10]

There’s an options page with only one option -for the moment-, new options will be implemented on demand (as long as they make sense). Right now the only global option is the numberposts parameter, to define a default number of posts to show for each instance (you can override this value by using the numberposts parameter in your shortcode).

Read the instructions to learn which parameters are available and how to use them.

If you want to List Categories instead of posts you can use my other plugin List categories.

You can find Frequently Asked Questions here.

Customization

The different elements to display can be styled with CSS. you can define an HTML tag to wrap the element with, and a CSS class for this tag. Check the documentation for usage. You can also check this nice tutorial which gives lots of tips and how-to’s to customize how to display the posts.

Great to use WordPress as a CMS, and create pages with several categories posts.

GUI

Klemens Starybrat has created a GUI for List Category Posts. It helps you create a shortcode from a nice visual interface in WordPress’ text editor. Check it out: GUI for List Category Posts

AJAX pagination

The ajax pagination feature is maintained in an add-on plugin by Klemens Starybrat. Check it out: LCP Ajax Pagination

Widget

Since WordPress 4.9, you can use shortcode in text widgets. So you can just add a text widget in Appearence > Widgets and write the List Category Posts shortcode.

The plugin also includes a widget as a simple interface for its functionality. Just add as many widgets as you want, and select all the available options from the Appearence > Widgets page. Not all the functionality in the shortcode has been implemented in the widget yet. You can use the shortcode for the most flexibility.

Please, read the information on the wiki and Changelog to be aware of new functionality, and improvements to the plugin.

Videos

Some users have made videos on how to use the plugin (thank you, you are awesome!), check them out here:

Support the plugin

Klemens Starybrat has been writing lots of amazing code for this plugin, so if you’ve found it useful and want to pay it forward, consider sponsoring him on GitHub: https://github.com/sponsors/klemens-st

I have a PayPal account where you can donate too.

Development

Development is being tracked on GitHub. Fork it, code, make a pull request, suggest improvements, etc. over there. I dream of the day all of the WordPress plugins will be hosted on Git 🙂

Since the documentation on how to use the plugin has passed wordpress.org’s character limit, the text was cut. I’ve since started using a wiki for more comfortable reading and maintaining. Please check it out, suggestions are welcome on GitHub issues!

Instructions on how to use the plugin

Below you can find common shortcode use cases. You can use the shortcode while editing posts, pages, custom post types, text widgets and in all “page builder” plugins that support shortcodes.

Read the full documentation to discover many more features, including:

  • advanced post selection options (by date, search terms, custom fields, post types, custom taxonomies and more)
  • output customizations (show each post’s date, author, excerpt, thumbnail and more)
  • custom templates of your own design, based on a simple PHP example

List 10 latest posts:

[catlist]

The default number of listed posts is 10, to modify it you need to specify numberposts parameter:

[catlist numberposts=15]

List posts from the “Dogs” category:

[catlist name=Dogs]

List posts from the category with id 2:

[catlist id=2]

By default only the “post” post type is included. To list pages use:

[catlist post_type=page]

and for both posts and pages:

[catlist post_type="post,page"]

If we combine the above options we can get a shortcode that lists 15 items, including post and pages, from the “Dogs” category:

[catlist name=Dogs post_type="post,page" numberposts=15]

Most of the parameters you will find in the documentation can be used together.

The plugin can detect current post’s category and use it for listing:

[catlist categorypage=yes]

Same goes for tags:

[catlist currenttags=yes]

To show each post’s excerpt use:

[catlist excerpt=yes]

各投稿の横に日付、作成者、コメント数を表示するには、次を使用します。

[catlist date=yes author=yes comments=yes]

多くの要素に対して html タグとクラスを指定できます。 前のショートコードを変更して、選択したタグとクラスで日付と作成者をラップしましょう。

[catlist date=yes date_tag=span date_class="my-date" author=yes author_tag=p author_class="my-author" comments=yes]

Read more about this feature

投稿を日付順に並べ替えることができます。

[catlist orderby=date]

titleauthorID も使用できます。 その他のオプションについては、ドキュメントに記載されています。

The plugin also supports pagination. You need to specify numberposts to tell the plugin how many posts per page you want:

[catlist pagination=yes numberposts=5]

See the wiki: Pagination for more information.

Please read the full documentation for detailed documentation of all plugin features, use cases and shortcode parameters.

無料Creator プランを利用中
インストールすることで、WordPress.com の利用規約サードパーティ製プラグインの規約に同意したとみなされます。
有効インストール数
100K
最大テスト回数
6.4.5
このプラグインをダウンロードして、インストール型 WordPress のインストールに使用できます。