Title: Sectors &#8211; Conditional Templates &amp; Hooks
Author: Joachim Jensen
Published: <strong>फेब्रुअरी 5, 2018</strong>
Last modified: जुलाई 28, 2024

---

प्लगिनहरू खोज्नुहोस्

![](https://ps.w.org/sectors/assets/banner-772x250.png?rev=2064763)

यो प्लगिन **वर्डप्रेसका ३ प्रमुख नवीनतम रिलीजहरूसँग परीक्षण गरिएको छैन**। यो अब 
सम्भवतः व्यवस्थित वा समर्थन नभएको हुन सक्छ र वर्डप्रेसका नयाँ संस्करणहरूमा प्रयोग
गर्दा अनुकूलता सम्बन्धी समस्या हुन सक्छ।

![](https://ps.w.org/sectors/assets/icon-256x256.png?rev=2064763)

# Sectors – Conditional Templates & Hooks

 [Joachim Jensen](https://profiles.wordpress.org/intoxstudio/) द्वारा

[डाउनलोड गर्नुहोस्](https://downloads.wordpress.org/plugin/sectors.zip)

 * [विवरण](https://ne.wordpress.org/plugins/sectors/#description)
 * [समीक्षाहरू](https://ne.wordpress.org/plugins/sectors/#reviews)
 *  [स्थापना](https://ne.wordpress.org/plugins/sectors/#installation)
 * [विकास](https://ne.wordpress.org/plugins/sectors/#developers)

 [सहायता](https://wordpress.org/support/plugin/sectors/)

## विवरण

Sectors is a first of its kind plugin for WordPress. Create theme templates for 
any context on your site. Make sure select Actions or Filters are only added when
certain conditions are met.

#### Contexts

When you add a new sector to your site, you select the content it covers. This could
be:

 * All posts in a select category
 * Pages by an author
 * Custom Post Types with a Custom Taxonomy
 * …
 * Any combination of above

Sectors also comes with built in support for BuddyPress, WPML, Polylang, and more.

#### Templates

Sectors will look in your theme folder for the following templates:

 * `/sectors/<sector-name>.php`
 * `/sector-<sector-name>.php`

If found, it will be automatically loaded for the context.

#### API

**Template Tags**

Check if a query is part of a given or any sector:

    ```
    is_sector(string $sector):boolean
    ```

Get all sectors for current context:

    ```
    get_current_sectors():array
    ```

**Hooks**

Sectors extends all WordPress Actions and Filters by adding a scope. This means 
you can add a callback to an action and make sure it’s only executed in a given 
context:

    ```
    add_sector_action(string $sector, string $tag, callable $function, int $priority = 10, int $accepted_args = 1 )

    add_sector_filter(string $sector, string $tag, callable $function, int $priority = 10, int $accepted_args = 1 )
    ```

## स्क्रिनसटहरू

[⌊Actions & Filters without Sectors⌉⌊Actions & Filters without Sectors⌉[

Actions & Filters without Sectors

[⌊Actions & Filters using Sectors⌉⌊Actions & Filters using Sectors⌉[

Actions & Filters using Sectors

## स्थापना

 1. Upload the full plugin directory to your `/wp-content/plugins/` directory or install
    the plugin through `Plugins` in the Admin Dashboard
 2. Activate the plugin through `Plugins` in the Admin Dashboard
 3. Create your first Sector under the menu _Sectors > Add New_

## समीक्षाहरू

यस प्लगिनको लागि कुनै समीक्षाहरू छैनन्।

## योगदानकर्ता र डेभलपरहरू

“Sectors – Conditional Templates & Hooks” खुला स्रोत सफ्टवेयर हो। निम्न व्यक्तिहरूले
यो प्लगिनमा योगदान गरेका छन्।

योगदानकर्ताहरू

 *   [ Joachim Jensen ](https://profiles.wordpress.org/intoxstudio/)
 *   [ DEV Institute ](https://profiles.wordpress.org/devinstitute/)

[“Sectors – Conditional Templates & Hooks” लाई आफ्नो भाषामा अनुवाद गर्नुहोस्](https://translate.wordpress.org/projects/wp-plugins/sectors)

### विकासमा रुचि छ?

[आरएसएस](https://plugins.trac.wordpress.org/log/sectors/?limit=100&mode=stop_on_copy&format=rss)
द्वारा [कोड ब्राउज गर्नुहोस्](https://plugins.trac.wordpress.org/browser/sectors/),
[एसभीएन रिपजिटरी](https://plugins.svn.wordpress.org/sectors/) हेर्नुहोस्, वा [विकास लग](https://plugins.trac.wordpress.org/log/sectors/)
को सदस्यता लिनुहोस्।

## चेन्जलग

#### 1.2

 * Added: wordpress 5.5 support
 * Added: minimum wordpress version 4.8
 * Added: minimum php version 5.6
 * Updated: wp-content-aware-engine
 * Updated: wp-db-updater

#### 1.1

 * Added: api to get current sectors
 * Added: ‘sector’ to body class
 * Added: ui improvements
 * Updated: wp-content-aware-engine

#### 1.0

 * Welcome

## मेटा

 *  संस्करण **1.2**
 *  पछिल्लो अपडेट **2 वर्ष अघि**
 *  सक्रिय स्थापना **10+**
 *  वर्डप्रेस संस्करण ** 4.8 वा उच्च **
 *  जाँच गरिएको **6.6.7**
 *  PHP संस्करण ** 5.6 वा उच्च **
 *  भाषा
 * [English (US)](https://wordpress.org/plugins/sectors/)
 * ट्यागहरू
 * [actions](https://ne.wordpress.org/plugins/tags/actions/)[filters](https://ne.wordpress.org/plugins/tags/filters/)
   [hooks](https://ne.wordpress.org/plugins/tags/hooks/)
 *  [उन्नत दृश्य](https://ne.wordpress.org/plugins/sectors/advanced/)

## रेटिङ्गहरू

अहिलेसम्म कुनै समीक्षा पेस गरिएको छैन।

[तपाईँको समीक्षा](https://wordpress.org/support/plugin/sectors/reviews/#new-post)

[सबै समीक्षाहरू हेर्नुहोस्](https://wordpress.org/support/plugin/sectors/reviews/)

## योगदानकर्ताहरू

 *   [ Joachim Jensen ](https://profiles.wordpress.org/intoxstudio/)
 *   [ DEV Institute ](https://profiles.wordpress.org/devinstitute/)

## सहायता

केही भन्नु छ? सहयोग चाहियो?

 [सहायता फोरम हेर्नुहोस्](https://wordpress.org/support/plugin/sectors/)