Title: Select Primary Category
Author: denizozsen
Published: <strong>13 ژوئن 2018</strong>
Last modified: 13 ژوئن 2018

---

جستجوی افزونه‌ها

این افزونه **با ۳ نگارش عمدهٔ اخیر وردپرس آزمایش نشده است**. ممکن است دیگر نگهداری
یا پشتیبانی نشود و هنگام استفاده با نگارش‌های تازه‌تر وردپرس مشکل سازگاری داشته 
باشد.

![](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://fa.wordpress.org/plugins/deniz-primary-category/#description)
 * [نقد و بررسی‌ها](https://fa.wordpress.org/plugins/deniz-primary-category/#reviews)
 *  [نصب](https://fa.wordpress.org/plugins/deniz-primary-category/#installation)
 * [توسعه](https://fa.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.

## سوالات متداول

  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/) را بررسی کنید،
یا از طریق [RSS](https://plugins.trac.wordpress.org/log/deniz-primary-category/?limit=100&mode=stop_on_copy&format=rss)
در [گزارش توسعه](https://plugins.trac.wordpress.org/log/deniz-primary-category/)
مشترک شوید.

## گزارش تغییرات

#### 1.0

 * Initial public release.

## اطلاعات

 *  نگارش **1.0**
 *  آخرین به‌روزرسانی **8 سال پیش**
 *  نصب‌های فعال **کمتر از 10**
 *  نگارش وردپرس ** 4.5 یا بالاتر **
 *  زبان
 * [English (US)](https://wordpress.org/plugins/deniz-primary-category/)
 * برچسب
 * [category](https://fa.wordpress.org/plugins/tags/category/)[primary](https://fa.wordpress.org/plugins/tags/primary/)
   [taxonomy](https://fa.wordpress.org/plugins/tags/taxonomy/)
 *  [نمایش پیشرفته](https://fa.wordpress.org/plugins/deniz-primary-category/advanced/)

## امتیازها

هنوز هیچ نقدی ارسال نشده است.

[بررسی شما](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/)