Title: Select Primary Category
Author: denizozsen
Published: <strong>2018年6月13日</strong>
Last modified: 2018年6月13日

---

プラグインを検索

このプラグインは **WordPress の最新3回のメジャーリリースに対してテストされていま
せん**。もうメンテナンスやサポートがされていないかもしれず、最新バージョンの WordPress
で使用した場合は互換性の問題が発生する可能性があります。

![](https://s.w.org/plugins/geopattern-icon/deniz-primary-category.svg)

# Select Primary Category

 作者: [denizozsen](https://profiles.wordpress.org/denizozsen/)

[ダウンロード](https://downloads.wordpress.org/plugin/deniz-primary-category.zip)

 * [詳細](https://ja.wordpress.org/plugins/deniz-primary-category/#description)
 * [レビュー](https://ja.wordpress.org/plugins/deniz-primary-category/#reviews)
 *  [インストール](https://ja.wordpress.org/plugins/deniz-primary-category/#installation)
 * [開発](https://ja.wordpress.org/plugins/deniz-primary-category/#developers)

 [サポート](https://wordpress.org/support/plugin/deniz-primary-category/)

## 説明

Features:
 * Ability to designate a primary category for posts and custom post types.*
Supports custom post types and custom taxonomies with hierarchical structure. * 
Category in permalink is the primary category, if one is set. * Shortcode for displaying
posts with a specific primary category. * CLI command for listing posts with a specific
primary category.

## インストール

 1. Add the plugin folder to WordPress’ plugin directory.
 2. Activate the plugin from Admin > Plugins.
 3. Start using it.

## FAQ

  Installation Instructions

 1. Add the plugin folder to WordPress’ plugin directory.
 2. Activate the plugin from Admin > Plugins.
 3. Start using it.

  When using the shortcode, do I need to use the primary category’s ID, slug or 
name?

You can use either of them. E.g. assuming a category with ID 3, slug ‘ground-coffee’
and name ‘Ground Coffee’.
 the following shortcode definitions will all work:

    ```
    [posts_by_primary_category category="3"]
    [posts_by_primary_category category="ground-coffee"]
    [posts_by_primary_category category="Ground Coffee"]
    ```

  Developers’ Notes

If you want to fetch posts belonging to a particular category (or, more generally,
belonging to a particular term)
 you can use this:

    ```
    if ( class_exists( 'SPC_Queries' ) ) {
        /*
         * Let's fetch 10 published posts with primary category set to category ID 2.
         */
        $spc_queries =  SPC_Infrastructure_Container::get_instance()->get( 'SPC_Queries' );
        $posts = $spc_queries->get_primary_term_posts( 2, array(
            'post_status'    => 'publish',
            'posts_per_page' => 10,
            'post_type'      => 'post',
        ) );
    }
    ```

You can just as well pass a category slug or name, instead of its ID, if you prefer.

## 評価

このプラグインにはレビューがありません。

## 貢献者と開発者

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

貢献者

 *   [ denizozsen ](https://profiles.wordpress.org/denizozsen/)

[“Select Primary Category” をあなたの言語に翻訳しましょう。](https://translate.wordpress.org/projects/wp-plugins/deniz-primary-category)

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

[コードを閲覧](https://plugins.trac.wordpress.org/browser/deniz-primary-category/)
するか、[SVN リポジトリ](https://plugins.svn.wordpress.org/deniz-primary-category/)
をチェックするか、[開発ログ](https://plugins.trac.wordpress.org/log/deniz-primary-category/)
を [RSS](https://plugins.trac.wordpress.org/log/deniz-primary-category/?limit=100&mode=stop_on_copy&format=rss)
で購読してみてください。

## 変更履歴

#### 1.0

 * Initial public release.

## メタ

 *  バージョン **1.0**
 *  最終更新日 **8年前**
 *  有効インストール数 **10未満**
 *  WordPress バージョン ** 4.5またはそれ以降 **
 *  言語
 * [English (US)](https://wordpress.org/plugins/deniz-primary-category/)
 * タグ
 * [category](https://ja.wordpress.org/plugins/tags/category/)[primary](https://ja.wordpress.org/plugins/tags/primary/)
   [taxonomy](https://ja.wordpress.org/plugins/tags/taxonomy/)
 *  [詳細を表示](https://ja.wordpress.org/plugins/deniz-primary-category/advanced/)

## 評価

レビューはまだ送信されていません。

[Your review](https://wordpress.org/support/plugin/deniz-primary-category/reviews/#new-post)

[すべてのレビューを見る](https://wordpress.org/support/plugin/deniz-primary-category/reviews/)

## 貢献者

 *   [ denizozsen ](https://profiles.wordpress.org/denizozsen/)

## サポート

意見や質問がありますか ?

 [サポートフォーラムを表示](https://wordpress.org/support/plugin/deniz-primary-category/)