Title: Primary Categories
Author: Jacob McKinney
Published: <strong>17 Maaie, 2016</strong>
Last modified: 5 Augustus, 2018

---

Search plugins

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

Dizze plugin **is net hifke mei de lêste 3 grutte releases fan WordPress** . It 
kin net langer wurde ûnderhâlden of stipe en kin kompatibiliteitsproblemen hawwe
as it wurdt brûkt mei resinte ferzjes fan WordPress.

![](https://ps.w.org/primary-categories/assets/icon-128x128.png?rev=1419117)

# Primary Categories

 Troch [Jacob McKinney](https://profiles.wordpress.org/jacobmc/)

[Download](https://downloads.wordpress.org/plugin/primary-categories.zip)

 * [Details](https://fy.wordpress.org/plugins/primary-categories/#description)
 * [Resinsjes](https://fy.wordpress.org/plugins/primary-categories/#reviews)
 *  [Ynstallaasje](https://fy.wordpress.org/plugins/primary-categories/#installation)
 * [Ûntwikkeling](https://fy.wordpress.org/plugins/primary-categories/#developers)

 [Stypje](https://wordpress.org/support/plugin/primary-categories/)

## Beskriuwing

WordPress plugin for setting and displaying primary categories for posts and custom
post types*.

This plugin creates a meta box on the post edit screen titled “Primary Category”
containing a drop down menu populated with all categories associated with that post**.
Selecting a primary category and updating the post saves this data into a custom
field with a meta key of “primary-category”.

To display a list of all posts with a particular primary category, use the shortcode[
primary-category name=”cat_name”] where cat_name is the name of the primary category
you wish to display. If a name is not specified, the shortcode will default to all
posts with “uncategorized” set as the primary category.

*Note: Custom post types must support both categories and custom fields.

**Note: As new categories are added to a post, the post must be updated before those
new categories will be available for selection as a primary category.

## Skermôfbyldings

[⌊Example of post edit screen with primary category meta box.⌉⌊Example of post edit
screen with primary category meta box.⌉[

Example of post edit screen with primary category meta box.

[⌊Example of shortcode being used in page.⌉⌊Example of shortcode being used in page
.⌉[

Example of shortcode being used in page.

[⌊Example output of shortcode.⌉⌊Example output of shortcode.⌉[

Example output of shortcode.

## Ynstallaasje

This section describes how to install the plugin and get it working.

 1. Upload the ‘primary-categories’ directory to your ‘/wp-content/plugins/’ directory,
    or install the plugin through the WordPress plugins screen directly
 2. Activate the plugin through the ‘Plugins’ screen in WordPress
 3. Select the primary category for each post via the post edit screen
 4. Place shortcode to the content of any post type or access the data via the post
    meta key ‘primary-category’

## FAQ

  How can I access the primary category data?

A post’s primary category is stored in the post meta under the key ‘primary-category’.

  What shortcode can I use to display posts with a particular primary category?

[primary-category name=””]

*Note: Name should reference the primary category that is to be displayed, if no
name is specified, the name parameter defaults to ‘uncategorized’.

  Why isn’t the category I added available as a primary category?

Users must update a post after adding a new category before that category will be
available as a primary category.

## Resinsjes

![](https://secure.gravatar.com/avatar/b828a77df9d90f9254e7f0eeb2ca11b77987aab1bbb6ffc05d6f7ce3a89aa669?
s=60&d=retro&r=g)

### 󠀁[Well structured code, works as expected](https://wordpress.org/support/topic/well-structured-code-works-as-expected/)󠁿

 [jgangso](https://profiles.wordpress.org/jgangso/) 29 Juny, 2017

The plugin does just what it says. The code is well-structured and seems very lightweight.
What would make it 5 stars were: – possibility to control which post types the plugin
applies to by filter – localization – (perhaps out-of-scope) allow developers to
control which taxonomy is used on each post type by filter (custom post types often
have custom taxonomies as well)

![](https://secure.gravatar.com/avatar/97bbe4fe76251bd8de789468d4e055a2a38da2615beb64caba53e5aff6c24084?
s=60&d=retro&r=g)

### 󠀁[Works fine,thanks](https://wordpress.org/support/topic/works-finethanks-2/)󠁿

 [General Seed](https://profiles.wordpress.org/autocultivo/) 3 Septimber, 2016

Thanks Jacob for this plugin, works fine and is very usefull.Keep update when need
it because it,s a necesary plugin. Five Stars, thanks.

 [ Lês alle 2 resinsjes ](https://wordpress.org/support/plugin/primary-categories/reviews/)

## Meiwurkers & amp; Untwikkelders

“Primary Categories” is iepen boarne software. De folgjende minsken hawwe bydroegen
oan dizze plugin.

Meiwurkers

 *   [ Jacob McKinney ](https://profiles.wordpress.org/jacobmc/)

[Oersette “Primary Categories” yn jo taal.](https://translate.wordpress.org/projects/wp-plugins/primary-categories)

### Ynteressearre yn ûntwikkeling?

[Blêdzje troch de koade](https://plugins.trac.wordpress.org/browser/primary-categories/),
besjoch de [SVN-repository](https://plugins.svn.wordpress.org/primary-categories/),
of abonnearje op it [ûntwikkelingslogboek](https://plugins.trac.wordpress.org/log/primary-categories/)
troch [RSS](https://plugins.trac.wordpress.org/log/primary-categories/?limit=100&mode=stop_on_copy&format=rss).

## Feroaringslog

#### 1.0.0

Initial Commit

## Meta

 *  Version **1.0.0**
 *  Last updated **8 jier yn ôl**
 *  Active installations **20+**
 *  WordPress version ** 3.4 of heger **
 *  Tested up to **4.9.31**
 *  Language
 * [English (US)](https://wordpress.org/plugins/primary-categories/)
 * Tags
 * [categories](https://fy.wordpress.org/plugins/tags/categories/)[shortcodes](https://fy.wordpress.org/plugins/tags/shortcodes/)
 *  [Avansearre werjefte](https://fy.wordpress.org/plugins/primary-categories/advanced/)

## Wurdearrings

 4.5 fan 5 stjerren.

 *  [  1 resinsje mei 5 stjer     ](https://wordpress.org/support/plugin/primary-categories/reviews/?filter=5)
 *  [  1 resinsje mei 4 stjer     ](https://wordpress.org/support/plugin/primary-categories/reviews/?filter=4)
 *  [  0 resinsjes mei 3 stjerren     ](https://wordpress.org/support/plugin/primary-categories/reviews/?filter=3)
 *  [  0 resinsjes mei 2 stjerren     ](https://wordpress.org/support/plugin/primary-categories/reviews/?filter=2)
 *  [  0 resinsjes mei 1 stjerren     ](https://wordpress.org/support/plugin/primary-categories/reviews/?filter=1)

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

[See all reviews](https://wordpress.org/support/plugin/primary-categories/reviews/)

## Meiwurkers

 *   [ Jacob McKinney ](https://profiles.wordpress.org/jacobmc/)

## Stypje

Hast wat te sizzen? Help nedich hawwe?

 [Besjoch stipefoarum](https://wordpress.org/support/plugin/primary-categories/)