PHPackages                             wpscholar/wp-context - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. wpscholar/wp-context

ActiveLibrary[Templating &amp; Views](/categories/templating)

wpscholar/wp-context
====================

A WordPress context library based on WordPress' built-in template hierarchy.

1.1(6y ago)36021GPL-2.0+PHP

Since Sep 15Pushed 6y ago1 watchersCompare

[ Source](https://github.com/wpscholar/wp-context)[ Packagist](https://packagist.org/packages/wpscholar/wp-context)[ RSS](/packages/wpscholar-wp-context/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)DependenciesVersions (4)Used By (1)

WordPress Context
=================

[](#wordpress-context)

A WordPress context library based on WordPress' built-in template hierarchy.

What It Does
------------

[](#what-it-does)

Designed to be used after the main WordPress query has run, this context library will return an array of slugs representing the current context.

How to Use It
-------------

[](#how-to-use-it)

1. Add to your project via [Composer](https://getcomposer.org/):

```
$ composer require wpscholar/wp-context
```

2. Make sure you have added the Composer autoloader to your project:

```
